summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-28 02:07:53 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-28 02:07:53 (GMT)
commitd7e1b2bd17cee31bb581a71fff20101be0b34bc6 (patch)
treea30973b18a8b5bf84e25eae590181cce9a59a217 /Python
parent908caac52e8e62baa1ee54e4e650e1cd3ac37907 (diff)
downloadcpython-d7e1b2bd17cee31bb581a71fff20101be0b34bc6.zip
cpython-d7e1b2bd17cee31bb581a71fff20101be0b34bc6.tar.gz
cpython-d7e1b2bd17cee31bb581a71fff20101be0b34bc6.tar.bz2
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')
-rw-r--r--Python/compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c
index aee7bda..3501b95 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1153,7 +1153,7 @@ compiler_mod(struct compiler *c, mod_ty mod)
int addNone = 1;
static PyObject *module;
if (!module) {
- module = PyString_FromString("<module>");
+ module = PyString_InternFromString("<module>");
if (!module)
return NULL;
}
@@ -2001,7 +2001,7 @@ compiler_assert(struct compiler *c, stmt_ty s)
if (Py_OptimizeFlag)
return 1;
if (assertion_error == NULL) {
- assertion_error = PyString_FromString("AssertionError");
+ assertion_error = PyString_InternFromString("AssertionError");
if (assertion_error == NULL)
return 0;
}