Skip to content

Commit

Permalink
Convert ImportErrors into ModuleNotFoundError (#2135)
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangb committed Apr 26, 2023
1 parent 882ab69 commit f3cf506
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 f3cf506

Please sign in to comment.