19 lines
444 B
Python
19 lines
444 B
Python
"""Optional native SETProtocol backend, configured by SETPROTOCOL_LIBRARY."""
|
|
|
|
from __future__ import annotations
|
|
|
|
def _load():
|
|
try:
|
|
from protocan.native import NativeProtocol
|
|
return NativeProtocol()
|
|
except (ImportError, OSError, RuntimeError):
|
|
return None
|
|
|
|
|
|
SHARED_PROTOCOL = _load()
|
|
|
|
|
|
def get_shared_protocol():
|
|
"""Return SETProtocol, or None for source/test fallback builds."""
|
|
return SHARED_PROTOCOL
|