cross-platform for preprocess support

This commit is contained in:
alexlnkp
2023-08-02 05:56:40 +07:00
parent 0b2f3fc080
commit 90aea45c14
2 changed files with 1035 additions and 1028 deletions

13
LazyImport.py Normal file
View File

@@ -0,0 +1,13 @@
from importlib.util import find_spec, LazyLoader, module_from_spec
from sys import modules
def lazyload(name):
if name in modules:
return modules[name]
else:
spec = find_spec(name)
loader = LazyLoader(spec.loader)
module = module_from_spec(spec)
modules[name] = module
loader.exec_module(module)
return module

File diff suppressed because it is too large Load Diff