Skip to content

Commit

Permalink
Merge pull request #4113 from dalthviz/fixes_issue_4063
Browse files Browse the repository at this point in the history
PR: Add a validation for the PyQt version used to show a message in the Python console
  • Loading branch information
ccordoba12 authored Feb 6, 2017
2 parents 9e8550c + cd8c0e7 commit 368b2e0
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions spyder/plugins/externalconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,19 @@ def start(self, fname, wdir=None, args='', interact=False, debug=False,
if old_shell.is_running():
runconfig = get_run_configuration(fname)
if runconfig is None or runconfig.show_kill_warning:
answer = QMessageBox.question(self, self.get_plugin_title(),
_("%s is already running in a separate process.\n"
"Do you want to kill the process before starting "
"a new one?") % osp.basename(fname),
QMessageBox.Yes | QMessageBox.Cancel)
if PYQT5:
answer = QMessageBox.question(self, self.get_plugin_title(),
_("%s is already running in a separate process.\n"
"Do you want to kill the process before starting "
"a new one?") % osp.basename(fname),
QMessageBox.Yes | QMessageBox.Cancel)
else:
mb = QMessageBox(self)
answer = mb.question(mb, self.get_plugin_title(),
_("%s is already running in a separate process.\n"
"Do you want to kill the process before starting "
"a new one?") % osp.basename(fname),
QMessageBox.Yes | QMessageBox.Cancel)
else:
answer = QMessageBox.Yes

Expand Down

0 comments on commit 368b2e0

Please sign in to comment.