diff --git a/fierce/fierce.py b/fierce/fierce.py index cc0d53e..52df3f6 100755 --- a/fierce/fierce.py +++ b/fierce/fierce.py @@ -59,23 +59,21 @@ def find_subdomain_list_file(filename): return os.path.abspath(filename_path) try: - import pkg_resources + import importlib except ImportError: return filename # If the relative check failed then attempt to find the list file # in the pip package directory. This will typically happen on pip package # installs (duh) - package_filename_path = os.path.join("lists", filename) try: - full_package_path = pkg_resources.resource_filename( - "fierce", - package_filename_path - ) + # Use importlib.resources.as_file when Python 3.9 is minimum version + full_package_path = importlib.resources.path("fierce.lists", filename) except ImportError: return filename - return full_package_path + with full_package_path as path: + return str(path) def head_request(url, timeout=2):