Skip to content

Commit

Permalink
Convert ImportErrors into ModuleNotFoundError (encode#2135)
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangb committed Apr 29, 2023
1 parent d094b64 commit d200842
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion starlette/formparsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
try:
import multipart
from multipart.multipart import parse_options_header
except ImportError: # pragma: nocover
except ModuleNotFoundError: # pragma: nocover
parse_options_header = None
multipart = None

Expand Down
2 changes: 1 addition & 1 deletion starlette/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

try:
from multipart.multipart import parse_options_header
except ImportError: # pragma: nocover
except ModuleNotFoundError: # pragma: nocover
parse_options_header = None


Expand Down
2 changes: 1 addition & 1 deletion starlette/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

try:
import yaml
except ImportError: # pragma: nocover
except ModuleNotFoundError: # pragma: nocover
yaml = None # type: ignore[assignment]


Expand Down
2 changes: 1 addition & 1 deletion starlette/templating.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
pass_context = jinja2.pass_context
else: # pragma: nocover
pass_context = jinja2.contextfunction # type: ignore[attr-defined]
except ImportError: # pragma: nocover
except ModuleNotFoundError: # pragma: nocover
jinja2 = None # type: ignore[assignment]


Expand Down

0 comments on commit d200842

Please sign in to comment.