Skip to content

Commit f8add0e

Browse files
committed
Simplify module___init___impl
1 parent 30fc873 commit f8add0e

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Objects/moduleobject.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -715,16 +715,7 @@ static int
715715
module___init___impl(PyModuleObject *self, PyObject *name, PyObject *doc)
716716
/*[clinic end generated code: output=e7e721c26ce7aad7 input=57f9e177401e5e1e]*/
717717
{
718-
PyObject *dict = self->md_dict;
719-
if (dict == NULL) {
720-
dict = PyDict_New();
721-
if (dict == NULL)
722-
return -1;
723-
self->md_dict = dict;
724-
}
725-
if (module_init_dict(self, dict, name, doc) < 0)
726-
return -1;
727-
return 0;
718+
return module_init_dict(self, self->md_dict, name, doc);
728719
}
729720

730721
static void

0 commit comments

Comments
 (0)