Author: Maciej Fijalkowski <[email protected]>
Branch:
Changeset: r60230:4cd8686d3e2d
Date: 2013-01-20 12:50 +0200
http://bitbucket.org/pypy/pypy/changeset/4cd8686d3e2d/
Log: merge
diff --git a/pypy/interpreter/astcompiler/asthelpers.py
b/pypy/interpreter/astcompiler/asthelpers.py
--- a/pypy/interpreter/astcompiler/asthelpers.py
+++ b/pypy/interpreter/astcompiler/asthelpers.py
@@ -43,7 +43,7 @@
if self.elts:
for elt in self.elts:
elt.set_context(ctx)
- self.ctx = ctx
+ self.ctx = ctx
class __extend__(ast.Attribute):
diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py
b/pypy/interpreter/astcompiler/test/test_compiler.py
--- a/pypy/interpreter/astcompiler/test/test_compiler.py
+++ b/pypy/interpreter/astcompiler/test/test_compiler.py
@@ -782,6 +782,36 @@
source = "for x in y: pass\n" * 1000
compile_with_astcompiler(source, 'exec', self.space)
+ def test_assign_to_empty_list_1(self):
+ source = """if 1:
+ for i in range(5):
+ del []
+ [] = ()
+ [] = []
+ [] = [] = []
+ ok = 1
+ """
+ self.simple_test(source, 'ok', 1)
+
+ def test_assign_to_empty_list_2(self):
+ source = """if 1:
+ for i in range(5):
+ try: [] = 1, 2, 3
+ except ValueError: pass
+ else: raise AssertionError
+ try: [] = a = 1
+ except TypeError: pass
+ else: raise AssertionError
+ try: [] = _ = iter(['foo'])
+ except ValueError: pass
+ else: raise AssertionError
+ try: [], _ = iter(['foo']), 1
+ except ValueError: pass
+ else: raise AssertionError
+ ok = 1
+ """
+ self.simple_test(source, 'ok', 1)
+
class AppTestCompiler:
diff --git a/rpython/jit/backend/test/test_ll_random.py
b/rpython/jit/backend/test/test_ll_random.py
--- a/rpython/jit/backend/test/test_ll_random.py
+++ b/rpython/jit/backend/test/test_ll_random.py
@@ -3,8 +3,7 @@
from rpython.jit.backend.test import test_random
from rpython.jit.metainterp.resoperation import ResOperation, rop
from rpython.jit.metainterp.history import ConstInt, ConstPtr
-from rpython.jit.metainterp.history import BoxPtr, BoxInt
-from rpython.jit.metainterp.history import BasicFailDescr
+from rpython.jit.metainterp.history import BoxPtr
from rpython.jit.codewriter import heaptracker
from rpython.jit.codewriter.effectinfo import EffectInfo
from rpython.rtyper.annlowlevel import llhelper
@@ -440,7 +439,7 @@
def produce_into(self, builder, r):
v_string = self.get_string(builder, r)
v_index = builder.get_index(len(v_string.getref(self.ptr).chars), r)
- v_result = builder.do(self.opnum, [v_string, v_index])
+ builder.do(self.opnum, [v_string, v_index])
class AbstractSetItemOperation(AbstractStringOperation):
def produce_into(self, builder, r):
@@ -556,7 +555,7 @@
descr = self.getcalldescr(builder, TP)
self.put(builder, args, descr)
op = ResOperation(rop.GUARD_NO_EXCEPTION, [], None,
- descr=BasicFailDescr())
+ descr=builder.getfaildescr())
op.setfailargs(fail_subset)
builder.loop.operations.append(op)
@@ -578,7 +577,7 @@
_, vtableptr = builder.get_random_structure_type_and_vtable(r)
exc_box = ConstAddr(llmemory.cast_ptr_to_adr(vtableptr), builder.cpu)
op = ResOperation(rop.GUARD_EXCEPTION, [exc_box], BoxPtr(),
- descr=BasicFailDescr())
+ descr=builder.getfaildescr())
op.setfailargs(builder.subset_of_intvars(r))
op._exc_box = None
builder.should_fail_by = op
@@ -599,7 +598,7 @@
self.put(builder, args, descr)
exc_box = ConstAddr(llmemory.cast_ptr_to_adr(exc), builder.cpu)
op = ResOperation(rop.GUARD_EXCEPTION, [exc_box], BoxPtr(),
- descr=BasicFailDescr())
+ descr=builder.getfaildescr())
op.setfailargs(fail_subset)
builder.loop.operations.append(op)
@@ -615,7 +614,7 @@
descr = self.getcalldescr(builder, TP)
self.put(builder, args, descr)
op = ResOperation(rop.GUARD_NO_EXCEPTION, [], BoxPtr(),
- descr=BasicFailDescr())
+ descr=builder.getfaildescr())
op._exc_box = ConstAddr(llmemory.cast_ptr_to_adr(exc), builder.cpu)
op.setfailargs(builder.subset_of_intvars(r))
builder.should_fail_by = op
@@ -639,7 +638,7 @@
break
other_box = ConstAddr(llmemory.cast_ptr_to_adr(vtableptr), builder.cpu)
op = ResOperation(rop.GUARD_EXCEPTION, [other_box], BoxPtr(),
- descr=BasicFailDescr())
+ descr=builder.getfaildescr())
op._exc_box = ConstAddr(llmemory.cast_ptr_to_adr(exc), builder.cpu)
op.setfailargs(builder.subset_of_intvars(r))
builder.should_fail_by = op
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit