Author: Jeong YunWon <[email protected]>
Branch:
Changeset: r76571:806f912430a0
Date: 2015-03-25 18:28 +0900
http://bitbucket.org/pypy/pypy/changeset/806f912430a0/
Log: Similar cases in #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
@@ -884,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)
@@ -969,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.
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit