nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at haskell-updates 48 lines 1.4 kB view raw
1diff --git a/setup.cfg b/setup.cfg 2index b04257d..f5c436a 100644 3--- a/setup.cfg 4+++ b/setup.cfg 5@@ -45,7 +45,6 @@ package_dir = 6 =src 7 zip_safe = False 8 install_requires = 9- importlib_resources 10 11 [options.packages.find] 12 where = src 13diff --git a/src/libusb_package/__init__.py b/src/libusb_package/__init__.py 14index 67e3e46..684be57 100644 15--- a/src/libusb_package/__init__.py 16+++ b/src/libusb_package/__init__.py 17@@ -21,10 +21,9 @@ import ctypes.util 18 import functools 19 import platform 20 import sys 21+from pathlib import Path 22 from typing import (Any, Optional, TYPE_CHECKING) 23 24-import importlib_resources 25- 26 from ._version import version as __version__ 27 28 if TYPE_CHECKING: 29@@ -49,18 +48,7 @@ def get_library_path() -> Optional[Path]: 30 The path is valid until the process exits. If the library was extracted from a zip in order to 31 be accessible as a file, it will be cleaned up with the process exits. 32 """ 33- lib_resource = importlib_resources.files(__name__).joinpath(_LIBRARY_NAME) 34- if lib_resource.is_file(): 35- path_context = importlib_resources.as_file(lib_resource) 36- path = path_context.__enter__() 37- 38- @atexit.register 39- def cleanup(): 40- path_context.__exit__(None, None, None) 41- 42- return path 43- else: 44- return None 45+ return Path('@libusb1@') 46 47 48 def find_library(candidate: str) -> Optional[str]: