Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fix for looking up print function in Python 3.

  • Loading branch information...
commit a7e8c7021c35e5ab3d749debb0d2aa77fd4c3c8a 1 parent 8a38592
@takluyver authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 IPython/core/
6 IPython/core/
@@ -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 &
+ 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}
@@ -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.
elif etype is UsageError:
print "UsageError:", value

0 comments on commit a7e8c70

Please sign in to comment.
Something went wrong with that request. Please try again.