[pypy-svn] pypy refactor-not-in-translator: (arigo, cfbolz): what's not tested is broken

cfbolz commits-noreply at bitbucket.org
Fri Feb 25 20:31:14 CET 2011


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: refactor-not-in-translator
Changeset: r42300:fb34c35512b7
Date: 2011-02-25 19:45 +0100
http://bitbucket.org/pypy/pypy/changeset/fb34c35512b7/

Log:	(arigo, cfbolz): what's not tested is broken

diff --git a/pypy/objspace/flow/objspace.py b/pypy/objspace/flow/objspace.py
--- a/pypy/objspace/flow/objspace.py
+++ b/pypy/objspace/flow/objspace.py
@@ -339,7 +339,7 @@
         except UnwrapException:
             pass
         else:
-            return not obj
+            return self.wrap(not obj)
         w_falthvalue = self.do_operation('is_false', w_obj)
         return w_falthvalue
 

diff --git a/pypy/objspace/flow/test/test_objspace.py b/pypy/objspace/flow/test/test_objspace.py
--- a/pypy/objspace/flow/test/test_objspace.py
+++ b/pypy/objspace/flow/test/test_objspace.py
@@ -834,6 +834,11 @@
             return not x
         graph = self.codetest(f)
         assert self.all_operations(graph) == {"is_false": 1}
+        x = True
+        def f():
+            return not x
+        graph = self.codetest(f)
+        assert self.all_operations(graph) == {}
 
 
     def test_context_manager(self):


More information about the Pypy-commit mailing list