summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-08-15 13:23:05 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-08-15 13:23:05 (GMT)
commit1432771d55b286ad3d14115a002195ff75cedae2 (patch)
treea8468a74151bb0b64a996256f4579d666d0939a7 /Objects
parent1fff00832639082d2d7aa354c8e6d9110171d6bc (diff)
downloadcpython-1432771d55b286ad3d14115a002195ff75cedae2.zip
cpython-1432771d55b286ad3d14115a002195ff75cedae2.tar.gz
cpython-1432771d55b286ad3d14115a002195ff75cedae2.tar.bz2
Merged revisions 74457 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74457 | benjamin.peterson | 2009-08-15 08:16:38 -0500 (Sat, 15 Aug 2009) | 1 line #6707 fix a crash with dir() on an uninitialized module ........
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 6845201..e8ac8a2 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1265,9 +1265,11 @@ _specialized_dir_module(PyObject *obj)
if (PyDict_Check(dict))
result = PyDict_Keys(dict);
else {
- PyErr_Format(PyExc_TypeError,
- "%.200s.__dict__ is not a dictionary",
- PyModule_GetName(obj));
+ const char *name = PyModule_GetName(obj);
+ if (name)
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.__dict__ is not a dictionary",
+ name);
}
}