Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fix Python 3.2 test failures (ResourceWarnings from unclosed files).

Closes gh-2083.
  • Loading branch information...
commit b1a8e9db1f79b2bca93799cd7644813b7f4a4221 1 parent 70ea9a8
@bfroehle bfroehle authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  IPython/utils/
3  IPython/utils/
@@ -73,7 +73,8 @@ def isidentifier(s, dotted=False):
def execfile(fname, glob, loc=None):
loc = loc if (loc is not None) else glob
- exec compile(open(fname, 'rb').read(), fname, 'exec') in glob, loc
+ with open(fname, 'rb') as f:
+ exec compile(, fname, 'exec') in glob, loc
# Refactor print statements in doctests.
_print_statement_re = re.compile(r"\bprint (?P<expr>.*)$", re.MULTILINE)
Please sign in to comment.
Something went wrong with that request. Please try again.