mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 14:21:53 +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
|