From 9f52036318c340fa214bc320f5e5ab61daef5852 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Fri, 27 Jan 2017 10:52:53 +0100 Subject: [PATCH] simplify if --- src/fenrir/utils/module_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fenrir/utils/module_utils.py b/src/fenrir/utils/module_utils.py index e6018db3..5b141e83 100644 --- a/src/fenrir/utils/module_utils.py +++ b/src/fenrir/utils/module_utils.py @@ -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)