Permalink
Browse files

Make IndentationErrors display like other SyntaxErrors

Closes gh-2398
  • Loading branch information...
1 parent 9733ec6 commit b1788e495f98ebc1c9185f40deccdf466efae69f @takluyver committed Sep 11, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 IPython/core/interactiveshell.py
  2. +1 −1 IPython/core/ultratb.py
@@ -1716,7 +1716,7 @@ def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None,
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)
@@ -1769,7 +1769,7 @@ def showsyntaxerror(self, filename=None):
"""
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:
View
@@ -552,7 +552,7 @@ def _format_exception_only(self, etype, value):
# Not sure if this can still happen in Python 2.6 and above
list.append( py3compat.cast_unicode(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 = "<string>"

0 comments on commit b1788e4

Please sign in to comment.