[pypy-commit] pypy default: Merged in youknowone/pypy (pull request #312)
fijal
noreply at buildbot.pypy.org
Thu Mar 26 11:01:15 CET 2015
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch:
Changeset: r76572:5eb7a0303b1b
Date: 2015-03-26 12:01 +0200
http://bitbucket.org/pypy/pypy/changeset/5eb7a0303b1b/
Log: Merged in youknowone/pypy (pull request #312)
issue #2005
diff --git a/pypy/module/imp/importing.py b/pypy/module/imp/importing.py
--- a/pypy/module/imp/importing.py
+++ b/pypy/module/imp/importing.py
@@ -621,7 +621,10 @@
try:
load_module(space, w_modulename, find_info, reuse=True)
finally:
- find_info.stream.close()
+ try:
+ find_info.stream.close()
+ except StreamErrors:
+ pass
# fetch the module again, in case of "substitution"
w_mod = check_sys_modules(space, w_modulename)
return w_mod
@@ -663,7 +666,10 @@
if find_info:
stream = find_info.stream
if stream:
- stream.close()
+ try:
+ stream.close()
+ except StreamErrors:
+ pass
if tentative:
return None
@@ -881,7 +887,10 @@
try:
code_w = read_compiled_module(space, cpathname, stream.readall())
finally:
- stream.close()
+ try:
+ stream.close()
+ except StreamErrors:
+ pass
space.setattr(w_mod, w('__file__'), w(cpathname))
else:
code_w = parse_source_module(space, pathname, source)
@@ -966,7 +975,10 @@
return stream
except StreamErrors:
if stream:
- stream.close()
+ try:
+ stream.close()
+ except StreamErrors:
+ pass
return None # XXX! must not eat all exceptions, e.g.
# Out of file descriptors.
More information about the pypy-commit
mailing list