From: Berker Peksag Date: Fri, 19 Aug 2016 09:00:13 +0000 (+0300) Subject: Issue #12946: Remove dead code in PyModule_GetDict X-Git-Tag: v3.6.0b1~667 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7fbce56a57bd8ef45191eb8e4abb4b5d8edb1384;p=thirdparty%2FPython%2Fcpython.git Issue #12946: Remove dead code in PyModule_GetDict PyModule_NewObject already sets md_dict to PyDict_New(): m->md_dict = PyDict_New(); --- diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index a4cdc206c12a..fb568f531d5e 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -444,8 +444,7 @@ PyModule_GetDict(PyObject *m) return NULL; } d = ((PyModuleObject *)m) -> md_dict; - if (d == NULL) - ((PyModuleObject *)m) -> md_dict = d = PyDict_New(); + assert(d != NULL); return d; }