From f4017eb5b6428071aceaa5f4023d8e59bf9c7fa8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Sep 2017 23:24:22 +0200 Subject: [PATCH] Ignore more Python warnings when importing in earlyinit With a17c4767d6de3259b295ed7c15e81f8279df165a we moved the first time pkg_resources is imported to earlyinit.py, which means less warnings were suppressed. Fixes #2990 --- qutebrowser/misc/earlyinit.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index e589cbeef..c2ab454ac 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -218,7 +218,14 @@ def _check_modules(modules): 'Flags not at the start of the expression'] with log.ignore_py_warnings( 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) except ImportError as e: _die(text, e)