[py-svn] r59871 - py/trunk/py/code

fijal at codespeak.net fijal at codespeak.net
Tue Nov 11 20:11:15 CET 2008


Author: fijal
Date: Tue Nov 11 20:11:14 2008
New Revision: 59871

Modified:
   py/trunk/py/code/excinfo.py
Log:
yet-another-except when trying to get source


Modified: py/trunk/py/code/excinfo.py
==============================================================================
--- py/trunk/py/code/excinfo.py	(original)
+++ py/trunk/py/code/excinfo.py	Tue Nov 11 20:11:14 2008
@@ -91,7 +91,10 @@
         except KeyboardInterrupt: 
             raise 
         except:
-            s = str(source[-1])
+            try:
+                s = str(source[-1])
+            except:
+                return 0
         return 4 + (len(s) - len(s.lstrip()))
 
     def _getentrysource(self, entry):



More information about the pytest-commit mailing list