mirror of
https://github.com/soimort/you-get.git
synced 2025-02-09 03:37:52 +03:00
Revert "Update setup.py: compatibility for older python versions"
This reverts commit 873ffdb61e
.
Minimun python version 3.7 already assures importlib availability
This commit is contained in:
parent
b935d3ed02
commit
19a4f15d60
5
setup.py
5
setup.py
@ -5,10 +5,9 @@ PACKAGE_NAME = 'you_get'
|
|||||||
|
|
||||||
PROJ_METADATA = '%s.json' % PROJ_NAME
|
PROJ_METADATA = '%s.json' % PROJ_NAME
|
||||||
|
|
||||||
import sys
|
|
||||||
if (sys.version_info >= (3, 12)):
|
|
||||||
import importlib.util
|
import importlib.util
|
||||||
import importlib.machinery
|
import importlib.machinery
|
||||||
|
|
||||||
def load_source(modname, filename):
|
def load_source(modname, filename):
|
||||||
loader = importlib.machinery.SourceFileLoader(modname, filename)
|
loader = importlib.machinery.SourceFileLoader(modname, filename)
|
||||||
spec = importlib.util.spec_from_file_location(modname, filename, loader=loader)
|
spec = importlib.util.spec_from_file_location(modname, filename, loader=loader)
|
||||||
@ -18,8 +17,6 @@ if (sys.version_info >= (3, 12)):
|
|||||||
# sys.modules[module.__name__] = module
|
# sys.modules[module.__name__] = module
|
||||||
loader.exec_module(module)
|
loader.exec_module(module)
|
||||||
return module
|
return module
|
||||||
else:
|
|
||||||
from imp import load_source
|
|
||||||
|
|
||||||
import os, json
|
import os, json
|
||||||
here = os.path.abspath(os.path.dirname(__file__))
|
here = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
Loading…
Reference in New Issue
Block a user