Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes #1027, the previous fix had a problem under windows.

Ensure that scripts are newline-terminated, apparently py3 complains when there's a missing newline and the last line ends in a comment.  This is probably a python bug, but we should protect against it nonetheless.
  • Loading branch information...
commit 206d3521c0f671bd0e1c514c88e78d4fd6d0e8ad 1 parent 36a1791
@fperez fperez authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  IPython/utils/py3compat.py
View
2  IPython/utils/py3compat.py
@@ -158,7 +158,7 @@ def execfile(fname, glob=None, loc=None):
# 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):
Please sign in to comment.
Something went wrong with that request. Please try again.