Oct-21-2020, 12:15 AM
I would assume you'd just raise the exception that you want to catch.
debug = True try: # run the exception if debug: raise ZeroDivisionError except ZeroDivisionError: print("Got division error without actually dividing") print("all done")