diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-12-10 18:14:16 (GMT) |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-12-10 18:14:16 (GMT) |
commit | 532d091d058bca2c43b24bc79b53aa70f5caa365 (patch) | |
tree | c612fe3a122c30045631831c2b1aa35530e164b7 /Objects/moduleobject.c | |
parent | fc55789cae2db09fe190989943b112fbdc0f5423 (diff) | |
download | cpython-532d091d058bca2c43b24bc79b53aa70f5caa365.zip cpython-532d091d058bca2c43b24bc79b53aa70f5caa365.tar.gz cpython-532d091d058bca2c43b24bc79b53aa70f5caa365.tar.bz2 |
Reverted accidental commit (from r87159)
Diffstat (limited to 'Objects/moduleobject.c')
-rw-r--r-- | Objects/moduleobject.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 8b22b7d..2c095a0 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -168,8 +168,8 @@ PyModule_GetDict(PyObject *m) return d; } -PyObject * -PyModule_GetNameObject(PyObject *m) +const char * +PyModule_GetName(PyObject *m) { PyObject *d; PyObject *nameobj; @@ -185,21 +185,7 @@ PyModule_GetNameObject(PyObject *m) PyErr_SetString(PyExc_SystemError, "nameless module"); return NULL; } - Py_INCREF(nameobj); - return nameobj; -} - -const char * -PyModule_GetName(PyObject *m) -{ - PyObject *nameobj; - char *utf8; - nameobj = PyModule_GetNameObject(m); - if (nameobj == NULL) - return NULL; - utf8 = _PyUnicode_AsString(nameobj); - Py_DECREF(nameobj); - return utf8; + return _PyUnicode_AsString(nameobj); } PyObject* |