diff Python/compile.c @ 45028:1c9ac00c4758 legacy-trunk

static PyObject* variables should use PyString_InternFromString() instead of PyObject_FromString() to store a python string in a function level static var.
author Christian Heimes <christian@cheimes.de>
date Mon, 28 Jan 2008 02:07:53 +0000
parents 69c5703d20fb
children 3f16ac915214
line wrap: on
line diff
--- a/Python/compile.c	Sun Jan 27 23:34:59 2008 +0000
+++ b/Python/compile.c	Mon Jan 28 02:07:53 2008 +0000
@@ -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;
 	}