Author: Philip Jenvey <pjen...@underboss.org> Branch: py3k Changeset: r84568:d463dd98e6a6 Date: 2016-05-21 18:23 -0700 http://bitbucket.org/pypy/pypy/changeset/d463dd98e6a6/
Log: utilize enumerate diff --git a/pypy/module/__builtin__/descriptor.py b/pypy/module/__builtin__/descriptor.py --- a/pypy/module/__builtin__/descriptor.py +++ b/pypy/module/__builtin__/descriptor.py @@ -70,11 +70,9 @@ w_obj = frame.locals_cells_stack_w[0] if not w_obj: raise oefmt(space.w_RuntimeError, "super(): arg[0] deleted") - index = 0 - for name in code.co_freevars: + for index, name in enumerate(code.co_freevars): if name == "__class__": break - index += 1 else: raise oefmt(space.w_RuntimeError, "super(): __class__ cell not found") # a kind of LOAD_DEREF _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit