Skip to content

Instantly share code, notes, and snippets.

@ssbb
Created December 19, 2015 20:24
Show Gist options
  • Save ssbb/9b040325f6e9145e7b43 to your computer and use it in GitHub Desktop.
Save ssbb/9b040325f6e9145e7b43 to your computer and use it in GitHub Desktop.
urls = [1, 2, 3]
def main():
while urls:
item = urls.pop(0)
print('Processing item: {}'.format(item))
tries = 0
while tries < 4:
try:
raise Exception('My Exception')
# Use break statement at the end.
except Exception:
print('error')
tries += 1
else:
return
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment