summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-28 02:38:20 +0000
committerChristian Heimes <christian@cheimes.de>2008-01-28 02:38:20 +0000
commit7c3baee3dba3cbc40125de3fac21138a582b3145 (patch)
tree10e9b886dc1662a93911086f19073c39bb462d24 /Python/compile.c
parent302e26a0dd13dd9c1153524523ef57fea243a266 (diff)
downloadcpython-7c3baee3dba3cbc40125de3fac21138a582b3145.tar.gz
Merged revisions 60379-60382 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r60381 | christian.heimes | 2008-01-28 03:07:53 +0100 (Mon, 28 Jan 2008) | 1 line static PyObject* variables should use PyString_InternFromString() instead of PyObject_FromString() to store a python string in a function level static var. ........
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 347a19281e..6ce465ccb1 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1133,7 +1133,7 @@ compiler_mod(struct compiler *c, mod_ty mod)
int addNone = 1;
static PyObject *module;
if (!module) {
- module = PyUnicode_FromString("<module>");
+ module = PyUnicode_InternFromString("<module>");
if (!module)
return NULL;
}
@@ -1477,7 +1477,7 @@ compiler_class(struct compiler *c, stmt_ty s)
/* initialize statics */
if (locals == NULL) {
- locals = PyUnicode_FromString("__locals__");
+ locals = PyUnicode_InternFromString("__locals__");
if (locals == NULL)
return 0;
}
@@ -2177,7 +2177,7 @@ compiler_assert(struct compiler *c, stmt_ty s)
if (Py_OptimizeFlag)
return 1;
if (assertion_error == NULL) {
- assertion_error = PyUnicode_FromString("AssertionError");
+ assertion_error = PyUnicode_InternFromString("AssertionError");
if (assertion_error == NULL)
return 0;
}