comparison 2.00/test-svn.py @ 37:ddb3e1098727

Cleaned up next() calls
author Oleg Oshmyan <chortos@inbox.lv>
date Fri, 03 Dec 2010 02:45:19 +0000
parents f90bd2d1a12b
children af9c45708987
comparison
equal deleted inserted replaced
36:faf0254fe279 37:ddb3e1098727
116 # shouldprintnames = len(globalconf.tasknames) > 1 116 # shouldprintnames = len(globalconf.tasknames) > 1
117 # except Exception: 117 # except Exception:
118 # # Try to retrieve the first two problem names and cache them on success 118 # # Try to retrieve the first two problem names and cache them on success
119 # globalconf.tasknames = iter(globalconf.tasknames) 119 # globalconf.tasknames = iter(globalconf.tasknames)
120 # try: 120 # try:
121 # try: 121 # first = next(globalconf.tasknames)
122 # first = next(globalconf.tasknames)
123 # except NameError:
124 # # Python 2.5 lacks the next() built-in
125 # first = globalconf.tasknames.next()
126 # except StopIteration: 122 # except StopIteration:
127 # globalconf.tasknames = () 123 # globalconf.tasknames = ()
128 # shouldprintnames = False 124 # shouldprintnames = False
129 # else: 125 # else:
130 # try: 126 # try:
131 # try: 127 # second = next(globalconf.tasknames)
132 # second = next(globalconf.tasknames)
133 # except NameError:
134 # second = globalconf.tasknames.next()
135 # except StopIteration: 128 # except StopIteration:
136 # globalconf.tasknames = first, 129 # globalconf.tasknames = first,
137 # shouldprintnames = False 130 # shouldprintnames = False
138 # else: 131 # else:
139 # globalconf.tasknames = itertools.chain((first, second), globalconf.tasknames) 132 # globalconf.tasknames = itertools.chain((first, second), globalconf.tasknames)