Skip to content

Commit

Permalink
Adding python2.7 fallback for getfullargspec().
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashank-Pandey-ML committed Jan 12, 2023
1 parent d4f7093 commit ae135ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion imcsdk/imccoreutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import os
import re
import logging
import sys

from . import imcgenutils
from . import mometa
Expand Down Expand Up @@ -76,7 +77,12 @@ def get_imc_obj(class_id, elem, mo_obj=None):
return imcmethod.ExternalMethod(class_id)
elif class_id in MO_CLASS_ID:
mo_class = load_class(class_id)
mo_class_params = inspect.getfullargspec(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] = None
Expand Down

0 comments on commit ae135ee

Please sign in to comment.