diff Objects/moduleobject.c @ 66822:4f849720bf41

Reverted accidental commit (from r87159)
author Alexander Belopolsky <alexander.belopolsky@gmail.com>
date Fri, 10 Dec 2010 18:14:16 +0000
parents 738eaeed0b1a
children 531f423b019d
line wrap: on
line diff
--- a/Objects/moduleobject.c	Fri Dec 10 18:11:24 2010 +0000
+++ b/Objects/moduleobject.c	Fri Dec 10 18:14:16 2010 +0000
@@ -168,8 +168,8 @@
     return d;
 }
 
-PyObject *
-PyModule_GetNameObject(PyObject *m)
+const char *
+PyModule_GetName(PyObject *m)
 {
     PyObject *d;
     PyObject *nameobj;
@@ -185,21 +185,7 @@
         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*