From 1280fbea8a2944c201affa50138abbe2050cc772 2010-04-23 05:16:32 From: Fernando Perez Date: 2010-04-23 05:16:32 Subject: [PATCH] Fix print_function bug for python 2.5 as well. --- 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