projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
091ba98
)
fix error when Lexicon source file cannot be open (Cython inside a ZIP file)
author
Lisandro Dalcin
<dalcinl@gmail.com>
Tue, 14 Apr 2009 20:39:38 +0000
(17:39 -0300)
committer
Lisandro Dalcin
<dalcinl@gmail.com>
Tue, 14 Apr 2009 20:39:38 +0000
(17:39 -0300)
Cython/Compiler/Scanning.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/Scanning.py
b/Cython/Compiler/Scanning.py
index 059e32e3f68ba75982b9ba62e3ebb49f6e59268a..d5eae3b6e405d15b7616885b81ac612c4cc8341d 100644
(file)
--- a/
Cython/Compiler/Scanning.py
+++ b/
Cython/Compiler/Scanning.py
@@
-48,6
+48,7
@@
def hash_source_file(path):
from hashlib import md5 as new_md5
except ImportError:
from md5 import new as new_md5
+ f = None
try:
try:
f = open(path, "rU")
@@
-56,7
+57,8
@@
def hash_source_file(path):
print("Unable to hash scanner source file (%s)" % e)
return ""
finally:
- f.close()
+ if f:
+ f.close()
# Normalise spaces/tabs. We don't know what sort of
# space-tab substitution the file may have been
# through, so we replace all spans of spaces and