simplify if
This commit is contained in:
parent
60591530ff
commit
9f52036318
@ -4,13 +4,13 @@
|
|||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
import sys
|
import sys
|
||||||
version = sys.version[:3] # we only need major.minor version.
|
version = sys.version[:3] # we only need major.minor version.
|
||||||
if version == "3.3" or version == "3.4":
|
if version in ["3.3","3.4"]:
|
||||||
from importlib.machinery import SourceFileLoader
|
from importlib.machinery import SourceFileLoader
|
||||||
else: # Python 3.5+, no support for python < 3.3.
|
else: # Python 3.5+, no support for python < 3.3.
|
||||||
import importlib.util
|
import importlib.util
|
||||||
|
|
||||||
def importModule(moduleName, moduleLocation):
|
def importModule(moduleName, moduleLocation):
|
||||||
if version == "3.3" or version == "3.4":
|
if version in ["3.3","3.4"]:
|
||||||
return SourceFileLoader(moduleName, moduleLocation).load_module()
|
return SourceFileLoader(moduleName, moduleLocation).load_module()
|
||||||
else:
|
else:
|
||||||
spec = importlib.util.spec_from_file_location(moduleName, moduleLocation)
|
spec = importlib.util.spec_from_file_location(moduleName, moduleLocation)
|
||||||
|
Loading…
Reference in New Issue
Block a user