static PyObject* variables should use PyString_InternFromString() instead of PyObject_FromString() to store a python string in a function level static var.
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 @@
int addNone = 1;
static PyObject *module;
if (!module) {
- module = PyString_FromString("<module>");
+ module = PyString_InternFromString("<module>");
if (!module)
return NULL;
}
@@ -2001,7 +2001,7 @@
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;
}