[pypy-svn] pypy default: PyPy's empty modules have an empty __dict__ instead of None.

amauryfa commits-noreply at bitbucket.org
Thu Jan 20 00:59:23 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r40958:72921157acbd
Date: 2011-01-20 00:57 +0100
http://bitbucket.org/pypy/pypy/changeset/72921157acbd/

Log:	PyPy's empty modules have an empty __dict__ instead of None.

diff --git a/lib-python/modified-2.7.0/test/test_module.py b/lib-python/modified-2.7.0/test/test_module.py
--- a/lib-python/modified-2.7.0/test/test_module.py
+++ b/lib-python/modified-2.7.0/test/test_module.py
@@ -1,6 +1,6 @@
 # Test the module type
 import unittest
-from test.test_support import run_unittest, gc_collect
+from test.test_support import run_unittest, gc_collect, check_impl_detail
 
 import sys
 ModuleType = type(sys)
@@ -10,8 +10,10 @@
         # An uninitialized module has no __dict__ or __name__,
         # and __doc__ is None
         foo = ModuleType.__new__(ModuleType)
-        self.assertTrue(foo.__dict__ is None)
-        self.assertRaises(SystemError, dir, foo)
+        self.assertFalse(foo.__dict__)
+        if check_impl_detail():
+            self.assertTrue(foo.__dict__ is None)
+            self.assertRaises(SystemError, dir, foo)
         try:
             s = foo.__name__
             self.fail("__name__ = %s" % repr(s))


More information about the Pypy-commit mailing list