summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-28 02:38:20 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-28 02:38:20 (GMT)
commitfe82e774ea203de277968216126e26d0d09b3a15 (patch)
treefa12e8ce128288a56c0566d76aeaa05b8dd3e6d2 /Python
parent26855635833fcd3f15786b4a9d4241ded293404c (diff)
downloadcpython-fe82e774ea203de277968216126e26d0d09b3a15.zip
cpython-fe82e774ea203de277968216126e26d0d09b3a15.tar.gz
cpython-fe82e774ea203de277968216126e26d0d09b3a15.tar.bz2
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. ........
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c4
-rw-r--r--Python/compile.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 2a0376a..05f6a81 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -1463,7 +1463,7 @@ builtin_round(PyObject *self, PyObject *args, PyObject *kwds)
}
if (round_str == NULL) {
- round_str = PyUnicode_FromString("__round__");
+ round_str = PyUnicode_InternFromString("__round__");
if (round_str == NULL)
return NULL;
}
@@ -1582,7 +1582,7 @@ builtin_trunc(PyObject *self, PyObject *number)
}
if (trunc_str == NULL) {
- trunc_str = PyUnicode_FromString("__trunc__");
+ trunc_str = PyUnicode_InternFromString("__trunc__");
if (trunc_str == NULL)
return NULL;
}
diff --git a/Python/compile.c b/Python/compile.c
index 347a192..6ce465c 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1133,7 +1133,7 @@ compiler_mod(struct compiler *c, mod_ty mod)
int addNone = 1;
static PyObject *module;
if (!module) {
- module = PyUnicode_FromString("<module>");
+ module = PyUnicode_InternFromString("<module>");
if (!module)
return NULL;
}
@@ -1477,7 +1477,7 @@ compiler_class(struct compiler *c, stmt_ty s)
/* initialize statics */
if (locals == NULL) {
- locals = PyUnicode_FromString("__locals__");
+ locals = PyUnicode_InternFromString("__locals__");
if (locals == NULL)
return 0;
}
@@ -2177,7 +2177,7 @@ compiler_assert(struct compiler *c, stmt_ty s)
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;
}