Author: Brian Kearns <[email protected]>
Branch: 
Changeset: r62597:6c2989efb370
Date: 2013-03-20 20:56 -0400
http://bitbucket.org/pypy/pypy/changeset/6c2989efb370/

Log:    some sanity checks so these don't silently fail if __pypy__ items
        are moved around

diff --git a/lib-python/2/collections.py b/lib-python/2/collections.py
--- a/lib-python/2/collections.py
+++ b/lib-python/2/collections.py
@@ -15,6 +15,7 @@
 try:
     from __pypy__ import newdict
 except ImportError:
+    assert '__pypy__' not in sys.builtin_module_names
     newdict = lambda _ : {}
 
 try:
diff --git a/lib-python/2/pickle.py b/lib-python/2/pickle.py
--- a/lib-python/2/pickle.py
+++ b/lib-python/2/pickle.py
@@ -1412,6 +1412,7 @@
 try:
     from __pypy__.builders import StringBuilder
 except ImportError:
+    assert '__pypy__' not in sys.builtin_module_names
     StringBuilderFile = StringIO
 else:
     class StringBuilderFile(object):
diff --git a/lib-python/2/sre_parse.py b/lib-python/2/sre_parse.py
--- a/lib-python/2/sre_parse.py
+++ b/lib-python/2/sre_parse.py
@@ -19,8 +19,8 @@
 try:
     from __pypy__ import newdict
 except ImportError:
-    def newdict(tp):
-        return {}
+    assert '__pypy__' not in sys.builtin_module_names
+    newdict = lambda _ : {}
 
 SPECIAL_CHARS = ".\\[{()*+?^$|"
 REPEAT_CHARS = "*+?{"
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to