[pypy-svn] pypy default: (lac, arigo)
arigo
commits-noreply at bitbucket.org
Wed Jan 19 17:34:15 CET 2011
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r40943:1bd1e3b5a39a
Date: 2011-01-18 18:46 +0100
http://bitbucket.org/pypy/pypy/changeset/1bd1e3b5a39a/
Log: (lac, arigo)
Mark as an implementation detail the fact that we need a real dict
as globals (but not locals) on CPython.
diff --git a/lib-python/modified-2.7.0/test/test_builtin.py b/lib-python/modified-2.7.0/test/test_builtin.py
--- a/lib-python/modified-2.7.0/test/test_builtin.py
+++ b/lib-python/modified-2.7.0/test/test_builtin.py
@@ -398,12 +398,16 @@
self.assertEqual(eval('dir()', g, m), list('xyz'))
self.assertEqual(eval('globals()', g, m), g)
self.assertEqual(eval('locals()', g, m), m)
- self.assertRaises(TypeError, eval, 'a', m)
+ # on top of CPython, the first dictionary (the globals) has to
+ # be a real dict. This is not the case on top of PyPy.
+ if check_impl_detail(pypy=False):
+ self.assertRaises(TypeError, eval, 'a', m)
+
class A:
"Non-mapping"
pass
m = A()
- self.assertRaises(TypeError, eval, 'a', g, m)
+ self.assertRaises((TypeError, AttributeError), eval, 'a', g, m)
# Verify that dict subclasses work as well
class D(dict):
More information about the Pypy-commit
mailing list