mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:15:12 +00:00
19 lines
333 B
Python
19 lines
333 B
Python
"""Test: imports within `ModuleNotFoundError` and `ImportError` handlers."""
|
|
|
|
|
|
def module_not_found_error():
|
|
try:
|
|
import orjson
|
|
|
|
return True
|
|
except ModuleNotFoundError:
|
|
return False
|
|
|
|
|
|
def import_error():
|
|
try:
|
|
import orjson
|
|
|
|
return True
|
|
except ImportError:
|
|
return False
|