Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Python3.11 #246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion imcsdk/imccoreutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand Down
8 changes: 7 additions & 1 deletion imcsdk/imcmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import logging
import os
import sys

from . import imcgenutils
from . import imccoreutils
Expand Down Expand Up @@ -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)
Expand Down