diff --git a/imcsdk/imccoreutils.py b/imcsdk/imccoreutils.py index 4808110..538e1db 100644 --- a/imcsdk/imccoreutils.py +++ b/imcsdk/imccoreutils.py @@ -195,7 +195,12 @@ def load_mo(elem): mo_class_id = elem.tag mo_class = load_class(mo_class_id) - mo_class_params = inspect.getargspec(mo_class.__init__)[0][2:] + if sys.version_info > (3, 0): + # Python 3 code in this block + mo_class_params = inspect.getfullargspec(mo_class.__init__)[0][2:] + else: + # Python 2 code in this block + mo_class_params = inspect.getargspec(mo_class.__init__)[0][2:] mo_class_param_dict = {} for param in mo_class_params: mo_class_param_dict[param] = elem.attrib[ diff --git a/imcsdk/imcmo.py b/imcsdk/imcmo.py index 0659f7d..ddb215e 100644 --- a/imcsdk/imcmo.py +++ b/imcsdk/imcmo.py @@ -17,6 +17,7 @@ import logging import os +import sys from . import imcgenutils from . import imccoreutils @@ -658,7 +659,12 @@ def __get_mo_obj(self, class_id): import inspect mo_class = imccoreutils.load_class(class_id) - mo_class_params = inspect.getargspec(mo_class.__init__)[0][2:] + if sys.version_info > (3, 0): + # Python 3 code in this block + mo_class_params = inspect.getfullargspec(mo_class.__init__)[0][2:] + else: + # Python 2 code in this block + mo_class_params = inspect.getargspec(mo_class.__init__)[0][2:] mo_class_param_dict = {} for param in mo_class_params: prop = imccoreutils.get_prop_meta(mo_class, param)