[pypy-svn] r48394 - in pypy/dist/pypy/translator/goal: . test2

tismer at codespeak.net tismer at codespeak.net
Thu Nov 8 04:44:55 CET 2007


Author: tismer
Date: Thu Nov  8 04:44:54 2007
New Revision: 48394

Modified:
   pypy/dist/pypy/translator/goal/app_main.py
   pypy/dist/pypy/translator/goal/test2/test_app_main.py
Log:
changed app_main to implement a correct app-leve "we_are_translated" function.
There are still lots of features which I would like to test for windows, but no idea how to do this. Help???

Modified: pypy/dist/pypy/translator/goal/app_main.py
==============================================================================
--- pypy/dist/pypy/translator/goal/app_main.py	(original)
+++ pypy/dist/pypy/translator/goal/app_main.py	Thu Nov  8 04:44:54 2007
@@ -188,11 +188,12 @@
 modules changeable, again.
 """
 
-try:
-    # for some reason, some tests break with this import
-    from pypy.rlib.objectmodel import we_are_translated
-except ImportError:
-    we_are_translated = lambda: False
+def we_are_translated():
+    # this function does not exist on app-level.
+    # Don't confuse it with
+    # from pypy.rlib.objectmodel import we_are_translated
+    # which I did.
+    return hasattr(sys, 'pypy_translation_info')
 
 class fake_os:
     def __init__(self):

Modified: pypy/dist/pypy/translator/goal/test2/test_app_main.py
==============================================================================
--- pypy/dist/pypy/translator/goal/test2/test_app_main.py	(original)
+++ pypy/dist/pypy/translator/goal/test2/test_app_main.py	Thu Nov  8 04:44:54 2007
@@ -338,7 +338,6 @@
         assert 'mymodule running' in data
         assert 'Name: __main__' in data
         # ignoring case for windows. abspath behaves different from autopath
-        # concerning drive letters right now
-        # XXX fix nt module to implement _getfullpathname
-        assert ('File: ' + p).lower() in data.lower()
-        assert ('Argv: ' + repr([p, 'extra'])).lower() in data.lower()
+        # concerning drive letters right now.
+        assert ('File: ' + p) in data
+        assert ('Argv: ' + repr([p, 'extra'])) in data



More information about the Pypy-commit mailing list