Skip to content

Commit 5b01fb5

Browse files
Apply suggestion from @vstinner
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent ea28d2b commit 5b01fb5

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

Python/import.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4468,10 +4468,7 @@ _PyImport_LazyImportModuleLevelObject(PyThreadState *tstate,
44684468
PyObject *globals, PyObject *locals,
44694469
PyObject *fromlist, int level)
44704470
{
4471-
if (name == NULL) {
4472-
_PyErr_SetString(tstate, PyExc_ValueError, "Empty module name");
4473-
return NULL;
4474-
}
4471+
assert(name != NULL);
44754472
if (!PyUnicode_Check(name)) {
44764473
_PyErr_Format(tstate, PyExc_TypeError,
44774474
"module name must be a string, got %T", name);

0 commit comments

Comments
 (0)