diff --git a/chirp/wxui/__init__.py b/chirp/wxui/__init__.py index ad01db3b5..c14702967 100644 --- a/chirp/wxui/__init__.py +++ b/chirp/wxui/__init__.py @@ -5,9 +5,9 @@ import os import sys -if sys.version_info < (3, 10): +try: import importlib_resources -else: +except ModuleNotFoundError: import importlib.resources as importlib_resources from chirp import directory diff --git a/chirp/wxui/main.py b/chirp/wxui/main.py index 88f5a50a6..55b0607db 100644 --- a/chirp/wxui/main.py +++ b/chirp/wxui/main.py @@ -24,9 +24,9 @@ import time import webbrowser -if sys.version_info < (3, 10): +try: import importlib_resources -else: +except ModuleNotFoundError: import importlib.resources as importlib_resources import wx diff --git a/setup.py b/setup.py index 3d5dafdc6..cb98aa333 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ 'pyserial', 'six', 'future', - 'importlib-resources;python_version<"3.10"', + 'importlib-resources;python_version<"3.9"', 'yattag', ], extras_require={