[pypy-svn] r8960 - pypy/dist/pypy/objspace/std

ac at codespeak.net ac at codespeak.net
Mon Feb 7 18:07:19 CET 2005


Author: ac
Date: Mon Feb  7 18:07:18 2005
New Revision: 8960

Modified:
   pypy/dist/pypy/objspace/std/listobject.py
Log:
Make it possible to run (but with failing tests) cpythons test_builtins

Modified: pypy/dist/pypy/objspace/std/listobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/listobject.py	(original)
+++ pypy/dist/pypy/objspace/std/listobject.py	Mon Feb  7 18:07:18 2005
@@ -47,6 +47,14 @@
         pass   # empty list
     elif len(args) == 1:
         w_iterable = args[0]
+        length = 0
+        try:
+            length = space.int_w(space.len(w_iterable))
+            if length < 0:
+                length = 8 
+        except OperationError, e:
+            pass # for now
+        _list_resize(w_list, length)
         w_iterator = space.iter(w_iterable)
         while True:
             try:



More information about the Pypy-commit mailing list