Reject empty module names -- otherwise __import__("") does something

weird!
This commit is contained in:
Guido van Rossum 1998-04-11 17:38:22 +00:00
parent 70c460c84d
commit 111c20b992

View file

@ -1515,6 +1515,11 @@ load_next(mod, altmod, p_name, buf, p_buflen)
*p_name = dot+1;
len = dot-name;
}
if (len == 0) {
PyErr_SetString(PyExc_ValueError,
"Empty module name");
return NULL;
}
p = buf + *p_buflen;
if (p != buf)