def f(): try: print('something') except Exception, e: # ... Code that does not use 'e' print('something else')