[issue23447] Import fails when doing a circular import involving an `import *`

Steven Barker report at bugs.python.org
Wed Sep 9 05:42:58 CEST 2015


Steven Barker added the comment:

I've managed to partially fix my build environment, so I can verify that my patch (attached previously) works as intended. I'm not completely sure that it doesn't break unrelated things as my build still has lots of failing tests (which all appear to be unrelated to this issue). Nothing obviously new breaks with the patch applied.

The test I added in the patch does fail (as expected) on the unpatched interpreter, but passes on a patched version (though I've just noticed that the attempt at catching the exception doesn't work, since the current import code raises an AttributeError rather than the ImportError I had expected). I don't believe any other tests failed anew on the patched code, but like I said, I've got a lot of unrelated test failures so I might be missing some subtle issues.

I'm attaching an updated version of the patch with better exception handling in the test code. The patch applies cleanly to the latest dev branch. I'd appreciate any reviews or other feedback.

----------
Added file: http://bugs.python.org/file40415/23447_3.diff

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


More information about the Python-bugs-list mailing list