at master 790 B view raw
1diff --git i/magic/loader.py w/magic/loader.py 2index 931f161..b8096d1 100644 3--- i/magic/loader.py 4+++ w/magic/loader.py 5@@ -35,16 +35,12 @@ def _lib_candidates(): 6 7 8 def load_lib(): 9+ lib = '@libmagic@' 10 11- for lib in _lib_candidates(): 12- # find_library returns None when lib not found 13- if lib is None: 14- continue 15- try: 16- return ctypes.CDLL(lib) 17- except OSError: 18- pass 19- else: 20- # It is better to raise an ImportError since we are importing magic module 21- raise ImportError('failed to find libmagic. Check your installation') 22+ try: 23+ return ctypes.CDLL(lib) 24+ except OSError: 25+ pass 26 27+ # It is better to raise an ImportError since we are importing magic module 28+ raise ImportError('failed to find libmagic. Check your installation')