Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert ImportErrors into ModuleNotFoundError #2135

Merged
merged 2 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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