diff options
author | Christian Heimes <christian@cheimes.de> | 2008-01-28 02:38:20 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-01-28 02:38:20 (GMT) |
commit | fe82e774ea203de277968216126e26d0d09b3a15 (patch) | |
tree | fa12e8ce128288a56c0566d76aeaa05b8dd3e6d2 /Objects/complexobject.c | |
parent | 26855635833fcd3f15786b4a9d4241ded293404c (diff) | |
download | cpython-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 'Objects/complexobject.c')
-rw-r--r-- | Objects/complexobject.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c index a7bf342..a08253e 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -265,13 +265,14 @@ PyComplex_AsCComplex(PyObject *op) /* return -1 on failure */ cv.real = -1.; cv.imag = 0.; - + + if (complex_str == NULL) { + if (!(complex_str = PyUnicode_FromString("__complex__"))) + return cv; + } + { PyObject *complexfunc; - if (!complex_str) { - if (!(complex_str = PyUnicode_FromString("__complex__"))) - return cv; - } complexfunc = _PyType_Lookup(op->ob_type, complex_str); /* complexfunc is a borrowed reference */ if (complexfunc) { |