I tried a syntax erroneous code in the try block, and tried to catch it. But I dont't know why It's keeping showing a syntax error.
def bad_fun(n):
try:
try:
print("we're good!")
print(int("7u"))
except ValueError,ZeroDivisionError:
print("Something wrong?")
return 1 / n
except ArithmeticError:
print("Arithmetic Problem!")
except SyntaxError:
print("handled")
return None
bad_fun(0)
print("THE END.")
The syntax error passed unhandled.