depot/third_party/nixpkgs/pkgs/development/python-modules/python-magic/libmagic-path.patch
Default email a3bb8d7922 Project import generated by Copybara.
GitOrigin-RevId: 439b1605227b8adb1357b55ce8529d541abbe9eb
2021-08-06 00:33:18 +03:00

28 lines
790 B
Diff

diff --git i/magic/loader.py w/magic/loader.py
index 931f161..b8096d1 100644
--- i/magic/loader.py
+++ w/magic/loader.py
@@ -35,16 +35,12 @@ def _lib_candidates():
def load_lib():
+ lib = '@libmagic@'
- for lib in _lib_candidates():
- # find_library returns None when lib not found
- if lib is None:
- continue
- try:
- return ctypes.CDLL(lib)
- except OSError:
- pass
- else:
- # It is better to raise an ImportError since we are importing magic module
- raise ImportError('failed to find libmagic. Check your installation')
+ try:
+ return ctypes.CDLL(lib)
+ except OSError:
+ pass
+ # It is better to raise an ImportError since we are importing magic module
+ raise ImportError('failed to find libmagic. Check your installation')