python - Excepting an error from a library an import is using -



python - Excepting an error from a library an import is using -

i want except requests.exceptions.connectionerror, beingness raised library importing. not importing requests. how can except specific exception?

if need grab connectionerror can import error , grab other error

from requests.exceptions import connectionerror try: code_that_raises_connection_error() except connectionerror: handle()

python import module

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -