[pypy-svn] r24175 - pypy/dist/pypy/objspace

cfbolz at codespeak.net cfbolz at codespeak.net
Thu Mar 9 14:35:18 CET 2006


Author: cfbolz
Date: Thu Mar  9 14:35:17 2006
New Revision: 24175

Modified:
   pypy/dist/pypy/objspace/logic.py
Log:
make the annotator happy: now find_last_var_in_chain is annotated to return a
W_Var


Modified: pypy/dist/pypy/objspace/logic.py
==============================================================================
--- pypy/dist/pypy/objspace/logic.py	(original)
+++ pypy/dist/pypy/objspace/logic.py	Thu Mar  9 14:35:17 2006
@@ -10,8 +10,12 @@
 
 def find_last_var_in_chain(w_var):
     w_curr = w_var
-    while isinstance(w_curr.w_bound_to, W_Var):
-        w_curr = w_curr.w_bound_to
+    while 1:
+        w_next = w_curr.w_bound_to
+        if isinstance(w_next, W_Var):
+            w_curr = w_next
+        else:
+            break
     return w_curr
 
 def force(space, w_self):



More information about the Pypy-commit mailing list