st_edits #6
|
|
@ -8,8 +8,7 @@ try:
|
|||
from pyrf.devices.thinkrf import WSA
|
||||
except ImportError as exc: # pragma: no cover - optional dependency
|
||||
raise ImportError(
|
||||
"pyrf is required to use the ThinkRF integration. "
|
||||
"Install with: pip install ria-toolkit-oss[thinkrf]"
|
||||
"pyrf is required to use the ThinkRF integration. " "Install with: pip install ria-toolkit-oss[thinkrf]"
|
||||
) from exc
|
||||
except SyntaxError as exc: # pragma: no cover - Python 2/3 compatibility issue
|
||||
import sys
|
||||
|
|
@ -19,12 +18,13 @@ except SyntaxError as exc: # pragma: no cover - Python 2/3 compatibility issue
|
|||
print("\033[93mWARNING: pyrf has Python 2 syntax. Attempting automatic fix...\033[0m")
|
||||
try:
|
||||
from lib2to3.refactor import RefactoringTool, get_fixers_from_package
|
||||
|
||||
import pyrf
|
||||
|
||||
thinkrf_path = Path(pyrf.__file__).resolve().parent / "devices" / "thinkrf.py"
|
||||
print(f"Fixing: {thinkrf_path}")
|
||||
|
||||
fixers = get_fixers_from_package('lib2to3.fixes')
|
||||
fixers = get_fixers_from_package("lib2to3.fixes")
|
||||
tool = RefactoringTool(fixers)
|
||||
tool.refactor_file(str(thinkrf_path), write=True)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user