[pypy-svn] r69998 - pypy/branch/listcopyop/pypy/rlib/parsing/test

fijal at codespeak.net fijal at codespeak.net
Tue Dec 8 20:07:59 CET 2009


Author: fijal
Date: Tue Dec  8 20:07:58 2009
New Revision: 69998

Modified:
   pypy/branch/listcopyop/pypy/rlib/parsing/test/test_pythonlexer.py
Log:
Be safe against pyc files


Modified: pypy/branch/listcopyop/pypy/rlib/parsing/test/test_pythonlexer.py
==============================================================================
--- pypy/branch/listcopyop/pypy/rlib/parsing/test/test_pythonlexer.py	(original)
+++ pypy/branch/listcopyop/pypy/rlib/parsing/test/test_pythonlexer.py	Tue Dec  8 20:07:58 2009
@@ -230,7 +230,10 @@
         assert tokens[i * 3].name == 'String'
 
 def test_self():
-    s = py.path.local(__file__).read()
+    fname = __file__
+    if fname.endswith('.pyc'):
+        fname = fname[:-1]
+    s = py.path.local(fname).read()
     tokens = pythonlexer.tokenize(s)
     print tokens
 



More information about the Pypy-commit mailing list