Skip to content
Browse files

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.

(cherry picked from commit b53d64b)
  • Loading branch information
nyalldawson committed Mar 7, 2019
1 parent 1b4e592 commit c1691ac9a2133d416b8a8c838b6a5a5806292108
Showing with 12 additions and 0 deletions.
  1. +12 −0 python/PyQt/PyQt5/uic/
@@ -23,7 +23,19 @@
# 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

0 comments on commit c1691ac

Please sign in to comment.
You can’t perform that action at this time.