Enable python warnings earlier and unconditionally.
This commit is contained in:
parent
21d2bb2291
commit
e7f5433da3
@ -24,7 +24,6 @@ import sys
|
|||||||
import subprocess
|
import subprocess
|
||||||
import configparser
|
import configparser
|
||||||
import signal
|
import signal
|
||||||
import warnings
|
|
||||||
import bdb
|
import bdb
|
||||||
import base64
|
import base64
|
||||||
import functools
|
import functools
|
||||||
@ -86,11 +85,6 @@ class Application(QApplication):
|
|||||||
self._crashdlg = None
|
self._crashdlg = None
|
||||||
self._crashlogfile = None
|
self._crashlogfile = None
|
||||||
|
|
||||||
if args.debug:
|
|
||||||
# We don't enable this earlier because some imports trigger
|
|
||||||
# warnings (which are not our fault).
|
|
||||||
warnings.simplefilter('default')
|
|
||||||
|
|
||||||
qt_args = qtutils.get_args(args)
|
qt_args = qtutils.get_args(args)
|
||||||
log.init.debug("Qt arguments: {}, based on {}".format(qt_args, args))
|
log.init.debug("Qt arguments: {}, based on {}".format(qt_args, args))
|
||||||
super().__init__(qt_args)
|
super().__init__(qt_args)
|
||||||
|
@ -27,6 +27,7 @@ import contextlib
|
|||||||
import collections
|
import collections
|
||||||
import faulthandler
|
import faulthandler
|
||||||
import traceback
|
import traceback
|
||||||
|
import warnings
|
||||||
|
|
||||||
from PyQt5.QtCore import (QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg,
|
from PyQt5.QtCore import (QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg,
|
||||||
qInstallMessageHandler)
|
qInstallMessageHandler)
|
||||||
@ -149,6 +150,7 @@ def init_log(args):
|
|||||||
root.addHandler(ram)
|
root.addHandler(ram)
|
||||||
root.setLevel(logging.NOTSET)
|
root.setLevel(logging.NOTSET)
|
||||||
logging.captureWarnings(True)
|
logging.captureWarnings(True)
|
||||||
|
warnings.simplefilter('default')
|
||||||
qInstallMessageHandler(qt_message_handler)
|
qInstallMessageHandler(qt_message_handler)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user