diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index b421d84..e1de793 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -1695,7 +1695,7 @@ class InteractiveShell(SingletonConfigurable): self.write_err('No traceback available to show.\n') return - if etype is SyntaxError: + if issubclass(etype, SyntaxError): # Though this won't be called by syntax errors in the input # line, there may be SyntaxError cases with imported code. self.showsyntaxerror(filename) @@ -1748,7 +1748,7 @@ class InteractiveShell(SingletonConfigurable): """ etype, value, last_traceback = self._get_exc_info() - if filename and etype is SyntaxError: + if filename and issubclass(etype, SyntaxError): try: value.filename = filename except: diff --git a/IPython/core/ultratb.py b/IPython/core/ultratb.py index a35d766..09c91bd 100644 --- a/IPython/core/ultratb.py +++ b/IPython/core/ultratb.py @@ -563,7 +563,7 @@ class ListTB(TBTools): # Not sure if this can still happen in Python 2.6 and above list.append( str(stype) + '\n') else: - if etype is SyntaxError: + if issubclass(etype, SyntaxError): have_filedata = True #print 'filename is',filename # dbg if not value.filename: value.filename = ""