Author: Ronan Lamy <[email protected]>
Branch: translation-cleanup
Changeset: r57618:53a80036a555
Date: 2012-09-26 21:32 +0100
http://bitbucket.org/pypy/pypy/changeset/53a80036a555/
Log: Remove dead code in FlowObjSpace.unpackiterable()
and make it clear that all cases are accounted for.
diff --git a/pypy/objspace/flow/objspace.py b/pypy/objspace/flow/objspace.py
--- a/pypy/objspace/flow/objspace.py
+++ b/pypy/objspace/flow/objspace.py
@@ -274,10 +274,10 @@
if expected_length is not None and len(l) != expected_length:
raise ValueError
return [self.wrap(x) for x in l]
- if isinstance(w_iterable, Variable) and expected_length is None:
- raise UnwrapException, ("cannot unpack a Variable iterable"
+ elif expected_length is None:
+ raise UnwrapException("cannot unpack a Variable iterable "
"without knowing its length")
- elif expected_length is not None:
+ else:
w_len = self.len(w_iterable)
w_correct = self.eq(w_len, self.wrap(expected_length))
if not self.is_true(w_correct):
@@ -285,7 +285,6 @@
raise e
return [self.do_operation('getitem', w_iterable, self.wrap(i))
for i in range(expected_length)]
- return ObjSpace.unpackiterable(self, w_iterable, expected_length)
# ____________________________________________________________
def do_operation(self, name, *args_w):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit