[pypy-svn] pypy default: do not crash in case the file is there but we do not have rights to open it

antocuni commits-noreply at bitbucket.org
Mon Mar 14 16:16:47 CET 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r42610:94c4f4d19961
Date: 2011-03-14 16:16 +0100
http://bitbucket.org/pypy/pypy/changeset/94c4f4d19961/

Log:	do not crash in case the file is there but we do not have rights to
	open it

diff --git a/pypy/tool/jitlogparser/storage.py b/pypy/tool/jitlogparser/storage.py
--- a/pypy/tool/jitlogparser/storage.py
+++ b/pypy/tool/jitlogparser/storage.py
@@ -31,8 +31,11 @@
             return res
 
     def disassemble_code(self, fname, startlineno):
-        if py.path.local(fname).check(file=False):
-            return None # cannot find source file
+        try:
+            if py.path.local(fname).check(file=False):
+                return None # cannot find source file
+        except py.error.EACCES:
+            return None # cannot open the file
         key = (fname, startlineno)
         try:
             return self.disassembled_codes[key]


More information about the Pypy-commit mailing list