simplify if

This commit is contained in:
chrys87 2017-01-27 10:52:53 +01:00 committed by GitHub
parent 60591530ff
commit 9f52036318

View File

@ -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)