diff --git a/IPython/utils/py3compat.py b/IPython/utils/py3compat.py index 57eca72..2c9df7c 100644 --- a/IPython/utils/py3compat.py +++ b/IPython/utils/py3compat.py @@ -158,7 +158,7 @@ else: # The rstrip() is necessary b/c trailing whitespace in files will # cause an IndentationError in Python 2.6 (this was fixed in 2.7, # but we still support 2.6). See issue 1027. - scripttext = __builtin__.open(fname).read().rstrip() + scripttext = __builtin__.open(fname).read().rstrip() + '\n' # compile converts unicode filename to str assuming # ascii. Let's do the conversion before calling compile if isinstance(fname, unicode):