[issue15610] PyImport_ImportModuleEx always fails in 3.3 with "ValueError: level must be >= 0"

Brett Cannon report at bugs.python.org
Fri Aug 10 17:03:31 CEST 2012


Brett Cannon added the comment:

OK, the macro expansion should get fixed, a versionchanged should probably be added to the C API docs (for PyImport_ImportModuleLevel()), and a line in What's New for porting C code should be added.

We can't go back to -1, as Eric said, because it makes no sense anymore since you can't syntactically do an import that has -1 level semantics in Python 3. The fact that __import__ accepted a negative level was a bug that went unnoticed up until this point since so few people import modules  programmatically and want implicit relative imports.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15610>
_______________________________________


More information about the Python-bugs-list mailing list