def patched_import(name, *args, **kwargs): if patch_qt_on_import == name or name.startswith(dotted): builtins.__import__ = original_import cancel_patches_in_sys_module() _internal_patch_qt(get_qt_core_module( )) # Patch it only when the user would import the qt module return original_import(name, *args, **kwargs)
def patched_import(name, *args, **kwargs): if patch_qt_on_import == name or name.startswith(dotted): builtins.__import__ = original_import cancel_patches_in_sys_module() _internal_patch_qt() # Patch it only when the user would import the qt module return original_import(name, *args, **kwargs)