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

Circular import import x25crc in generator/mavparse.py #913

Open
ScottHo opened this issue Feb 1, 2024 · 0 comments · May be fixed by #914
Open

Circular import import x25crc in generator/mavparse.py #913

ScottHo opened this issue Feb 1, 2024 · 0 comments · May be fixed by #914

Comments

@ScottHo
Copy link

ScottHo commented Feb 1, 2024

from .mavcrc import x25crc

The dot import is causing a circular import error on my end.

Changing the import to from pymavlink.generator.mavcrc import x25crc fixed it.

pymavlink version 2.4.41
python version 3.9
windows 10

File "...\lib\site-packages\pymavlink\generator\mavgen.py", line 243, in mavgen

   if not expand_includes():

File "...\lib\site-packages\pymavlink\generator\mavgen.py", line 116, in expand_includes

  if not expand_oneiteration():

File "...\lib\site-packages\pymavlink\generator\mavgen.py", line 110, in expand_oneiteration
   xml.append(mavparse.MAVXML(fname, opts.wire_protocol))

File "...\lib\site-packages\pymavlink\generator\mavparse.py", line 437, in __init__

   m.crc_extra = message_checksum(m)

File "...\lib\site-packages\pymavlink\generator\mavparse.py", line 459, in message_checksum

  from .mavcrc import x25crc
ImportError: cannot import name 'x25crc' from partially initialized module 'pymavlink.generator.mavcrc' (most likely due to a circular import) (...\lib\site-packages\pymavlink\generator\mavcrc.py)```
@ScottHo ScottHo linked a pull request Feb 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant