Kaydet (Commit) 2b6c2faa authored tarafından Guido van Rossum's avatar Guido van Rossum

Rewrite without using try-except to break out of two loops.

üst 870d5c67
...@@ -5,8 +5,8 @@ if __name__ == '__main__': ...@@ -5,8 +5,8 @@ if __name__ == '__main__':
verbose = 1 verbose = 1
maps = nis.maps() maps = nis.maps()
try: done = 0
for nismap in maps: for nismap in maps:
if verbose: if verbose:
print nismap print nismap
mapping = nis.cat(nismap) mapping = nis.cat(nismap)
...@@ -20,6 +20,7 @@ try: ...@@ -20,6 +20,7 @@ try:
else: else:
# just test the one key, otherwise this test could take a # just test the one key, otherwise this test could take a
# very long time # very long time
raise 'done' done = 1
except 'done': break
pass if done:
break
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment