Skip to content

Commit

Permalink
Merge from 3.x: PR #4914
Browse files Browse the repository at this point in the history
Fixes #4504
  • Loading branch information
ccordoba12 committed Aug 22, 2017
2 parents 8af09a3 + b0357e9 commit 93dd31d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spyder/widgets/ipythonconsole/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from qtpy.QtCore import Signal
from qtpy.QtWidgets import QMessageBox
from qtpy import PYQT4
from spyder.config.base import _
from spyder.config.gui import config_shortcut
from spyder.py3compat import PY2, to_text_string
Expand Down Expand Up @@ -405,6 +406,17 @@ def change_mpl_backend(self, command):
self.silent_execute(command)

#---- Private methods (overrode by us) ---------------------------------
def _handle_error(self, msg):
"""
Reimplemented to reset the prompt if the error comes after the reply
"""
# In pyqt4, if super does not has _handle_error, disregard the error
if PYQT4:
if not hasattr(super(ShellWidget, self), '_handle_error'):
return
super(ShellWidget, self)._handle_error(msg)
self._show_interpreter_prompt()

def _context_menu_make(self, pos):
"""Reimplement the IPython context menu"""
menu = super(ShellWidget, self)._context_menu_make(pos)
Expand Down

0 comments on commit 93dd31d

Please sign in to comment.