if name and name.endswith(")") and ".a(" in name:
mode |= _os.RTLD_MEMBER | _os.RTLD_NOW
self._name = name
+ if handle is not None:
+ return handle
return _dlopen(name, mode)
def __repr__(self):
lib = ctypes.WinDLL(name=None, handle=handle)
self.assertIs(handle, lib._handle)
+ @unittest.skipIf(os.name == "nt", 'POSIX-specific test')
+ @unittest.skipIf(libc_name is None, 'could not find libc')
+ def test_load_without_name_and_with_handle_posix(self):
+ lib1 = CDLL(libc_name)
+ handle = lib1._handle
+ lib2 = CDLL(name=None, handle=handle)
+ self.assertIs(lib2._handle, handle)
+
@unittest.skipUnless(os.name == "nt", 'Windows-specific test')
def test_1703286_A(self):
# On winXP 64-bit, advapi32 loads at an address that does