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

This commit is contained in:
Guido van Rossum 1996-12-11 16:28:30 +00:00
parent 870d5c67ae
commit 2b6c2faa64

View file

@ -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:
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