mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
Silence annoying PyQt5.uic.loadUiType deprecation warnings
These aren't our fault -- they come from the PyQt library itself, so we may as well hide them and avoid the noise.
This commit is contained in:
parent
6b1d5ee62c
commit
b53d64bfb0
@ -23,7 +23,19 @@ __copyright__ = '(C) 2016, Jürgen E. Fischer'
|
||||
# This will get replaced with a git SHA1 when you do a git archive
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import warnings
|
||||
from PyQt5.uic.Compiler import indenter, compiler
|
||||
from PyQt5.uic.objcreator import widgetPluginPath
|
||||
from PyQt5.uic import properties, uiparser, Compiler
|
||||
from PyQt5.uic import *
|
||||
|
||||
__PyQtLoadUiType = loadUiType
|
||||
|
||||
|
||||
def __loadUiType(*args, **kwargs):
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
||||
return __PyQtLoadUiType(*args, **kwargs)
|
||||
|
||||
|
||||
loadUiType = __loadUiType
|
||||
|
Loading…
x
Reference in New Issue
Block a user