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

core/__init__.py: Fix attribute check #862

Open
wants to merge 3 commits into
base: current
Choose a base branch
from

Conversation

elig0n
Copy link
Contributor

@elig0n elig0n commented Mar 20, 2024

Addressing the issue of registering groups ( #854 ) I changed the following:

Use an empty dict as a default for default_hints
Use hasattr() instead of bare object access/check

When default_hints is passed to the Status object instanciation the following error Fatal Error - ValueError(Additional arguments are invalid if 'module' is already an object) is shown.

This can be handled by excluding type of i3pystatus.group.Group in the check at L118 but I could not import the class due to:

  File "/github/i3pystatus/venv/lib/python3.11/site-packages/i3pystatus/core/__init__.py", line 6, in <module>
    from i3pystatus.group import Group
  File "/github/i3pystatus/venv/lib/python3.11/site-packages/i3pystatus/group.py", line 1, in <module>
    from i3pystatus import IntervalModule, Status, Module
ImportError: cannot import name 'IntervalModule' from partially initialized module 'i3pystatus' (most likely due to a circular import) (/github/i3pystatus/venv/lib/python3.11/site-packages/i3pystatus/__init__.py)

I could fix all imports but the import of Status which also showed the above error

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 this pull request may close these issues.

1 participant