Skip to content

Commit

Permalink
Fix for looking up print function in Python 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Sep 7, 2011
1 parent 8a38592 commit a7e8c70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions IPython/core/interactiveshell.py
Expand Up @@ -1281,8 +1281,8 @@ def _ofind(self, oname, namespaces=None):
# We need to special-case 'print', which as of python2.6 registers as a
# function but should only be treated as one if print_function was
# loaded with a future import. In this case, just bail.
if (oname == 'print' and not (self.compile.compiler_flags &
__future__.CO_FUTURE_PRINT_FUNCTION)):
if (oname == 'print' and not py3compat.PY3 and not \
(self.compile.compiler_flags & __future__.CO_FUTURE_PRINT_FUNCTION)):
return {'found':found, 'obj':obj, 'namespace':ospace,
'ismagic':ismagic, 'isalias':isalias, 'parent':parent}

Expand Down Expand Up @@ -1524,7 +1524,7 @@ def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None,

if etype is SyntaxError:
# Though this won't be called by syntax errors in the input
# line, there may be SyntaxError cases whith imported code.
# line, there may be SyntaxError cases with imported code.
self.showsyntaxerror(filename)
elif etype is UsageError:
print "UsageError:", value
Expand Down

0 comments on commit a7e8c70

Please sign in to comment.