diff options
author | Christian Heimes <christian@cheimes.de> | 2008-01-28 02:07:53 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-01-28 02:07:53 (GMT) |
commit | d7e1b2bd17cee31bb581a71fff20101be0b34bc6 (patch) | |
tree | a30973b18a8b5bf84e25eae590181cce9a59a217 /Python | |
parent | 908caac52e8e62baa1ee54e4e650e1cd3ac37907 (diff) | |
download | cpython-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.c | 4 |
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; } |