[pypy-commit] pypy default: Fix test after translation

arigo noreply at buildbot.pypy.org
Wed Mar 4 10:40:01 CET 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r76237:7517b098f581
Date: 2015-03-04 10:39 +0100
http://bitbucket.org/pypy/pypy/changeset/7517b098f581/

Log:	Fix test after translation

diff --git a/pypy/module/sys/test/test_sysmodule.py b/pypy/module/sys/test/test_sysmodule.py
--- a/pypy/module/sys/test/test_sysmodule.py
+++ b/pypy/module/sys/test/test_sysmodule.py
@@ -521,9 +521,11 @@
 
     def test_reload_doesnt_override_sys_executable(self):
         import sys
-        sys.executable = 'from_test_sysmodule'
+        if not hasattr(sys, 'executable'):    # if not translated
+            sys.executable = 'from_test_sysmodule'
+        previous = sys.executable
         reload(sys)
-        assert sys.executable == 'from_test_sysmodule'
+        assert sys.executable == previous
 
     def test_settrace(self):
         import sys


More information about the pypy-commit mailing list