]> granicus.if.org Git - python/commit
Issue #15715: Ignore failed imports triggered by the use of fromlist.
authorBrett Cannon <brett@python.org>
Fri, 17 Aug 2012 17:21:16 +0000 (13:21 -0400)
committerBrett Cannon <brett@python.org>
Fri, 17 Aug 2012 17:21:16 +0000 (13:21 -0400)
commit7385adc84cf7bc47b6975ba51fbf1da7b0a33b46
tree7b0918b655f0a1606607edfb05353954894b05f1
parentb391b24efe9d12e44e237064ea26be43d6a6e9a2
Issue #15715: Ignore failed imports triggered by the use of fromlist.

When the fromlist argument is specified for __import__() and the
attribute doesn't already exist, an import is attempted. If that fails
(e.g. module doesn't exist), the ImportError will now be silenced (for
backwards-compatibility). This *does not* affect
``from ... import ...`` statements.

Thanks to Eric Snow for the patch and Simon Feltman for reporting the
regression.
Lib/importlib/_bootstrap.py
Lib/test/test_import.py
Misc/NEWS
Python/importlib.h