diff --git a/IPython/core/magic.py b/IPython/core/magic.py index b27c577..0558746 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -41,6 +41,11 @@ except ImportError: except ImportError: profile = pstats = None +# print_function was added to __future__ in Python2.6, remove this when we drop +# 2.5 compatibility +if not hasattr(__future__,'CO_FUTURE_PRINT_FUNCTION'): + __future__.CO_FUTURE_PRINT_FUNCTION = 65536 + import IPython from IPython.core import debugger, oinspect from IPython.core.error import TryNext