Sample python file for which utest is to be written:
try:
code
except Exception as e:
print
try:
code
except Exception as e:
print
try:
code
except Exception as e:
print
try:
code
except Exception as e:
print
try:
code
except Exception as e:
print
try:
code
except Exception as e:
print
try:
code
except Exception as e:
print
I think you are looking for this:
try:
foo()
except (SomeException, OtherException, AnotherException) as exp:
...
https://docs.python.org/3/tutorial/errors.html#handling-exceptions
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.