From 1fc5392d530df5781ac604514fd5b147c444c74e 2013-09-16 20:06:02 From: Thomas Kluyver Date: 2013-09-16 20:06:02 Subject: [PATCH] Check for string_types instead of str --- diff --git a/IPython/core/ultratb.py b/IPython/core/ultratb.py index d9b292a..846d1a1 100644 --- a/IPython/core/ultratb.py +++ b/IPython/core/ultratb.py @@ -1198,7 +1198,8 @@ class SyntaxTB(ListTB): # If the source file has been edited, the line in the syntax error can # be wrong (retrieved from an outdated cache). This replaces it with # the current value. - if isinstance(value.filename, str) and isinstance(value.lineno, int): + if isinstance(value.filename, py3compat.string_types) \ + and isinstance(value.lineno, int): linecache.checkcache(value.filename) newtext = ulinecache.getline(value.filename, value.lineno) if newtext: