From e74d2ebedb53a1932f362a334a5fade8fa9a2c5c 2010-04-23 05:17:26 From: Fernando Perez Date: 2010-04-23 05:17:26 Subject: [PATCH] Fix print_function bug for python 2.5 as well. --- diff --git a/IPython/Magic.py b/IPython/Magic.py index 6ddf53d..d91c5b0 100644 --- a/IPython/Magic.py +++ b/IPython/Magic.py @@ -42,6 +42,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 + # Homebrewed import IPython from IPython import Debugger, OInspect, wildcard