Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix monkey-patching of QApplication #3312

Merged
merged 1 commit into from
Jul 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions spyderlib/app/spyder.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
from qtpy import QtSvg # analysis:ignore

# Avoid a bug in Qt: https://bugreports.qt.io/browse/QTBUG-46720
from qtpy import QtWebEngineWidgets
from qtpy import QtWebEngineWidgets # analysis:ignore


#==============================================================================
Expand Down Expand Up @@ -126,7 +126,6 @@
from spyderlib.app.cli_options import get_options
from spyderlib import dependencies
from spyderlib.config.ipython import QTCONSOLE_INSTALLED
from spyderlib.config.user import NoDefault
from spyderlib.py3compat import (getcwd, is_text_string, to_text_string,
PY3, qbytearray_to_str, u, configparser as cp)
from spyderlib.utils import encoding, programs
Expand Down Expand Up @@ -2888,7 +2887,7 @@ def initialize():
# possible
app = qapplication()

#----Monkey patching PyQt4.QtGui.QApplication
#----Monkey patching QApplication
class FakeQApplication(QApplication):
"""Spyder's fake QApplication"""
def __init__(self, args):
Expand All @@ -2897,8 +2896,8 @@ def __init__(self, args):
def exec_():
"""Do nothing because the Qt mainloop is already running"""
pass
from qtpy import QtGui
QtGui.QApplication = FakeQApplication
from qtpy import QtWidgets
QtWidgets.QApplication = FakeQApplication

#----Monkey patching rope
try:
Expand Down