diff options
| author | shadchin <[email protected]> | 2022-02-10 16:44:39 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:44:39 +0300 |
| commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
| tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/python/ipython/py2/IPython/terminal | |
| parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/ipython/py2/IPython/terminal')
| -rw-r--r-- | contrib/python/ipython/py2/IPython/terminal/pt_inputhooks/qt.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/contrib/python/ipython/py2/IPython/terminal/pt_inputhooks/qt.py b/contrib/python/ipython/py2/IPython/terminal/pt_inputhooks/qt.py index 74c8c153cdb..7395ac39ebe 100644 --- a/contrib/python/ipython/py2/IPython/terminal/pt_inputhooks/qt.py +++ b/contrib/python/ipython/py2/IPython/terminal/pt_inputhooks/qt.py @@ -1,29 +1,29 @@ import sys -import os +import os from IPython.external.qt_for_kernel import QtCore, QtGui # If we create a QApplication, keep a reference to it so that it doesn't get # garbage collected. _appref = None -_already_warned = False +_already_warned = False def inputhook(context): global _appref app = QtCore.QCoreApplication.instance() if not app: - if sys.platform == 'linux': - if not os.environ.get('DISPLAY') \ - and not os.environ.get('WAYLAND_DISPLAY'): - import warnings - global _already_warned - if not _already_warned: - _already_warned = True - warnings.warn( - 'The DISPLAY or WAYLAND_DISPLAY enviroment variable is ' - 'not set or empty and Qt5 requires this enviroment ' - 'variable. Deactivate Qt5 code.' - ) - return + if sys.platform == 'linux': + if not os.environ.get('DISPLAY') \ + and not os.environ.get('WAYLAND_DISPLAY'): + import warnings + global _already_warned + if not _already_warned: + _already_warned = True + warnings.warn( + 'The DISPLAY or WAYLAND_DISPLAY enviroment variable is ' + 'not set or empty and Qt5 requires this enviroment ' + 'variable. Deactivate Qt5 code.' + ) + return _appref = app = QtGui.QApplication([" "]) event_loop = QtCore.QEventLoop(app) |
