History

perf scripts python: exported-sql-viewer.py: Fix warning display

Deprecation warnings are useful only for the developer, not an end user. Display warnings only when requested using the python -W option. This stops the display of warnings like: tools/perf/scripts/python/exported-sql-viewer.py:5102: DeprecationWarning: an integer is required (got type PySide2.QtCore.Qt.AlignmentFlag). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python. err = app.exec_() Since the warning can be fixed only in PySide2, we must wait for it to be finally fixed there.

Adrian Hunter committed 5 years ago

Commit f56299a1 parent fd931b21 file · +5 −0Browse files

Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all

Unified · Split

tools/perf/scripts/python/exported-sql-viewer.py+5−0
@@ -91,6 +91,11 @@ · 90 unmodified lines
91from __future__ import print_function91from __future__ import print_function
92 92
93import sys93import sys
94# Only change warnings if the python -W option was not used
95if not sys.warnoptions:
96 import warnings
97 # PySide2 causes deprecation warnings, ignore them.
98 warnings.filterwarnings("ignore", category=DeprecationWarning)
94import argparse99import argparse
95import weakref100import weakref
96import threading101import threading