Skip to content

Commit

Permalink
Merge from 5.x: PR #17158
Browse files Browse the repository at this point in the history
Fixes #17042
  • Loading branch information
dalthviz committed Jan 10, 2022
2 parents 0c4f78f + 77e9721 commit f74775d
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions spyder/plugins/ipythonconsole/widgets/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ def _abort_kernel_restart(self):
stderr = self.stderr_obj.get_contents()
if not stderr:
return False
# There is an error. If it is only about comms, ignore.
# There is an error. If it is benign, ignore.
for line in stderr.splitlines():
if line and 'No such comm' not in line:
if line and not self.is_benign_error(line):
return True
return False

Expand Down Expand Up @@ -394,7 +394,7 @@ def poll_std_file_change(self):
stderr = self.stderr_obj.poll_file_change()
starting = self.shellwidget._starting
if stderr:
if self.is_bening_error(stderr):
if self.is_benign_error(stderr):
return
if self.shellwidget.isHidden():
# Avoid printing the same thing again
Expand Down Expand Up @@ -497,7 +497,7 @@ def show_kernel_error(self, error):
"""Show kernel initialization errors in infowidget."""
self.error_text = error

if self.is_bening_error(error):
if self.is_benign_error(error):
return

InstallerIPythonKernelError(error)
Expand Down Expand Up @@ -527,17 +527,22 @@ def show_kernel_error(self, error):
# Tell the client we're in error mode
self.is_error_shown = True

def is_bening_error(self, error):
def is_benign_error(self, error):
"""Decide if an error is benign in order to filter it."""
if "http://bugs.python.org/issue1666807" in error:
benign_errors = [
# See spyder-ide/spyder#16828
return True

if "https://bugs.python.org/issue1180193" in error:
"This version of python seems to be incorrectly compiled",
"internal generated filenames are not absolute",
"This may make the debugger miss breakpoints",
"http://bugs.python.org/issue1666807",
# See spyder-ide/spyder#16927
return True
"It seems the debugger cannot resolve",
"https://bugs.python.org/issue1180193",
# Old error
"No such comm"
]

return False
return any([err in error for err in benign_errors])

def get_name(self):
"""Return client name"""
Expand Down

0 comments on commit f74775d

Please sign in to comment.