import traceback
def func():
try:
-- do something --
except:
traceback.print_exc()
For this code
pylint reporting error: bare-except No exception type(s) specified , W0702, Occurs when an except clause doesn't specify exceptions type to catch.
Now, if I want all exceptions to be captured without pylint error. Is there a way.
Please help.
Thanks
I prefer using this more meaningful style:
def func():
try:
-- do something --
except: # pylint: disable=bare-except
traceback.print_exc()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With