[pypy-svn] r28944 - pypy/dist/pypy/module/__builtin__/test

hpk at codespeak.net hpk at codespeak.net
Mon Jun 19 14:31:48 CEST 2006


Author: hpk
Date: Mon Jun 19 14:31:47 2006
New Revision: 28944

Modified:
   pypy/dist/pypy/module/__builtin__/test/test_builtin.py
Log:
making applevel builtin oldstyle class test work on CPython 


Modified: pypy/dist/pypy/module/__builtin__/test/test_builtin.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/test/test_builtin.py	(original)
+++ pypy/dist/pypy/module/__builtin__/test/test_builtin.py	Mon Jun 19 14:31:47 2006
@@ -310,7 +310,10 @@
         assert callable(int), (
                     "Builtin function 'callable' misreads int")
         class Call:
-            __metaclass__ = _classobj
+            try:
+                __metaclass__ = _classobj
+            except NameError: # not running on PyPy, assuming oldstyle implicitely 
+                pass
             def __call__(self, a):
                 return a+2
         assert callable(Call())
@@ -330,7 +333,10 @@
         assert not callable(a), (
                     "Builtin function 'callable' tricked by instance-__call__")
         class NoCall:
-            __metaclass__ = _classobj
+            try:
+                __metaclass__ = _classobj
+            except NameError: # not running on PyPy, assuming oldstyle implicitely 
+                pass
         assert not callable(NoCall())
 
     def test_hash(self):



More information about the Pypy-commit mailing list