diff options
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/_bootstrap.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 8ecc882..471b380 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -1573,8 +1573,13 @@ def _handle_fromlist(module, fromlist, import_): fromlist.extend(module.__all__) for x in fromlist: if not hasattr(module, x): - _call_with_frames_removed(import_, - '{}.{}'.format(module.__name__, x)) + try: + _call_with_frames_removed(import_, + '{}.{}'.format(module.__name__, x)) + except ImportError: + # Backwards-compatibility dictates we ignore failed + # imports triggered by fromlist. + pass return module |