Ignore more Python warnings when importing in earlyinit
With a17c4767d6
we moved the first time
pkg_resources is imported to earlyinit.py, which means less warnings were
suppressed.
Fixes #2990
This commit is contained in:
parent
cd9fe57d84
commit
f4017eb5b6
@ -218,7 +218,14 @@ def _check_modules(modules):
|
|||||||
'Flags not at the start of the expression']
|
'Flags not at the start of the expression']
|
||||||
with log.ignore_py_warnings(
|
with log.ignore_py_warnings(
|
||||||
category=DeprecationWarning,
|
category=DeprecationWarning,
|
||||||
message=r'({})'.format('|'.join(messages))):
|
message=r'({})'.format('|'.join(messages))
|
||||||
|
), log.ignore_py_warnings(
|
||||||
|
category=PendingDeprecationWarning,
|
||||||
|
module='imp'
|
||||||
|
), log.ignore_py_warnings(
|
||||||
|
category=ImportWarning,
|
||||||
|
message=r'Not importing directory .*: missing __init__'
|
||||||
|
):
|
||||||
importlib.import_module(name)
|
importlib.import_module(name)
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
_die(text, e)
|
_die(text, e)
|
||||||
|
Loading…
Reference in New Issue
Block a user