Commit 887e9292 by devttys0

Modified C.py to search /usr/local/lib first.

parent 73b9c415
......@@ -124,15 +124,19 @@ class Library(object):
'win32' : ['%s.dll' % library]
}
lib_path = ctypes.util.find_library(library)
# If ctypes failed to find the library, check the common paths listed in system_paths
if not lib_path:
# Search the common install directories first; these are usually not in the library search path
# Search these *first*, since a) they are the most likely locations and b) there may be a
# discrepency between where ctypes.util.find_library and ctypes.cdll.LoadLibrary search for libs.
for path in system_paths[sys.platform]:
if os.path.exists(path):
lib_path = path
break
# If we failed to find the library, check the standard library search paths
if not lib_path:
lib_path = ctypes.util.find_library(library)
# If we still couldn't find the library, error out
if not lib_path:
raise Exception("Failed to locate library '%s'" % library)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment