Jython bug in CSM 2021x

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

Jython bug in CSM 2021x

Postby bobsimmons88@hotmail.com » Tue May 16, 2023 12:22 pm

CSM 2021x uses jython 2.7.2. Trying to import socket.py in one of my jython macros causes an error "Unable to import name Iterable". The bug seems to be in _socket.py with the line:

from collections import namedtuple, Iterable

Digging into the issue, my workaround was to split the import into two lines:

from collections import namedtuple
from _abcoll import Iterable

Looking at collections.py, which imports _abcoll.py, this shouldn't be necessary; the comments in _abcoll.py make clear that the intent is that everything is to be imported from the collections module.
Forum Newbie
Forum Newbie
Posts: 7
Posts Rating:0
Joined: Sun Apr 26, 2020 7:10 pm

Return to Programmatic Extendibility

Who is online

Users browsing this forum: No registered users and 0 guests