Author: Lukas Diekmann <[email protected]>
Branch: set-strategies
Changeset: r49269:fc5601b33c58
Date: 2011-11-08 14:12 +0100
http://bitbucket.org/pypy/pypy/changeset/fc5601b33c58/

Log:    referenced i before assignment if others_w is None/empty

diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py
--- a/pypy/objspace/std/setobject.py
+++ b/pypy/objspace/std/setobject.py
@@ -1227,7 +1227,8 @@
             startindex = i
             startlength = length
 
-    others_w[i], others_w[0] = others_w[0], others_w[i]
+    if i > 0:
+        others_w[i], others_w[0] = others_w[0], others_w[i]
 
     result = w_left._newobj(space, others_w[0])
     for i in range(1,len(others_w)):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to