diff Python/compile.c @ 45029:ef2d3bf8383d

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. ........
author Christian Heimes <christian@cheimes.de>
date Mon, 28 Jan 2008 02:38:20 +0000
parents 6547be11f443
children d7540031b959
line wrap: on
line diff
--- a/Python/compile.c	Sun Jan 27 23:50:43 2008 +0000
+++ b/Python/compile.c	Mon Jan 28 02:38:20 2008 +0000
@@ -1133,7 +1133,7 @@
 	int addNone = 1;
 	static PyObject *module;
 	if (!module) {
-		module = PyUnicode_FromString("<module>");
+		module = PyUnicode_InternFromString("<module>");
 		if (!module)
 			return NULL;
 	}
@@ -1477,7 +1477,7 @@
 
 	/* initialize statics */
 	if (locals == NULL) {
-		locals = PyUnicode_FromString("__locals__");
+		locals = PyUnicode_InternFromString("__locals__");
 		if (locals == NULL)
 			return 0;
 	}
@@ -2177,7 +2177,7 @@
 	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;
 	}