[py-svn] r35763 - py/dist/py/code

fijal at codespeak.net fijal at codespeak.net
Thu Dec 14 22:01:05 CET 2006


Author: fijal
Date: Thu Dec 14 22:01:01 2006
New Revision: 35763

Modified:
   py/dist/py/code/source.py
Log:
workaround old python version

Modified: py/dist/py/code/source.py
==============================================================================
--- py/dist/py/code/source.py	(original)
+++ py/dist/py/code/source.py	Thu Dec 14 22:01:01 2006
@@ -228,7 +228,10 @@
     try:
         fullsource = obj.co_filename.__source__
     except AttributeError:
-        strsrc = inspect.getsource(obj)
+        try:
+            strsrc = inspect.getsource(obj)
+        except IndentationError:
+            strsrc = "\"Buggy python version consider upgrading, cannot get source\""
         assert isinstance(strsrc, str)
         return Source(strsrc, **kwargs)
     else:



More information about the pytest-commit mailing list