simplify if
This commit is contained in:
parent
60591530ff
commit
9f52036318
@ -4,13 +4,13 @@
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
import sys
|
||||
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
|
||||
else: # Python 3.5+, no support for python < 3.3.
|
||||
import importlib.util
|
||||
|
||||
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()
|
||||
else:
|
||||
spec = importlib.util.spec_from_file_location(moduleName, moduleLocation)
|
||||
|
Loading…
Reference in New Issue
Block a user