[ctypes-commit] ctypes/ctypes _loader.py,1.1.2.7,1.1.2.8
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2006-01-26 07:24:24
|
Update of /cvsroot/ctypes/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10891 Modified Files: Tag: branch_1_0 _loader.py Log Message: load() calls dyld_find on OS X now. Index: _loader.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/Attic/_loader.py,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** _loader.py 26 Jan 2006 07:14:21 -0000 1.1.2.7 --- _loader.py 26 Jan 2006 07:24:16 -0000 1.1.2.8 *************** *** 108,115 **** constructor, it is ignored on Windows. """ - # XXX Should call dyld_find on OS X (?) if mode is None: mode = self._mode ! return self._dlltype(libname, mode) # Helper for load_version - assembles a filename from name and filename --- 108,114 ---- constructor, it is ignored on Windows. """ if mode is None: mode = self._mode ! return self._dlltype(_dyld_find(libname), mode) # Helper for load_version - assembles a filename from name and filename *************** *** 200,223 **** cdll = LibraryLoader(CDLL) ! if __name__ == "__main__": ! # platform independend tests ! print cdll.find("m") ! print cdll.find("c") ! print cdll.load_version("crypto", "0.9.7") ! if os.name == "posix" and sys.platform == "darwin": ! print cdll.load("libm.dylib") ! print cdll.load("libcrypt.dylib") ! else: ! print cdll.load("libm.so") ! print cdll.load("libcrypt.so") ! if os.name == "nt": ! ## load(filename) ! print cdll.load("msvcrt") ! print cdll.find("m") ! print cdll.load_version("msvcr", "71") ! ! ## load_version(name, version) ! ## find(name) --- 199,223 ---- cdll = LibraryLoader(CDLL) ! def test(): ! if os.name == "posix": ! # find and load_version ! print cdll.find("m") ! print cdll.find("c") ! print cdll.load_version("crypto", "0.9.7") ! # getattr ! print cdll.crypto ! print cdll.m ! # load ! if os.name == "posix" and sys.platform == "darwin": ! print cdll.load("libm.dylib") ! print cdll.load("libcrypto.dylib") ! print cdll.load("libSystem.dylib") ! print cdll.load("System.framework/System") ! else: ! print cdll.load("libm.so") ! print cdll.load("libcrypto.so") ! if __name__ == "__main__": ! test() |