1

Suppose I have the following:

exceptions: List[Exception]
exceptions = [ ValueError,TypeError,...]

And I would like to:

try: 
   # do something
   pass
except [e for e in exceptions]:
   # do something else

How would I do this?

Chris
  • 28,822
  • 27
  • 83
  • 158
  • 1
    maybe [this](https://stackoverflow.com/questions/6470428/catch-multiple-exceptions-in-one-line-except-block) can help – Kenan Jan 07 '20 at 18:47
  • 1
    Maybe [this answer](https://stackoverflow.com/a/46270444/4996248) will help. It seems that `except tuple(exceptions)` should work. – John Coleman Jan 07 '20 at 18:48

0 Answers0