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

AttributeError: When using gi.repository you must not import static modules like "gobject". Please change all occ... #200

Open
sentry-io bot opened this issue Jun 14, 2022 · 2 comments

Comments

@sentry-io
Copy link

sentry-io bot commented Jun 14, 2022

Sentry Issue: HM-CONFIG-32

AttributeError: When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject". See: https://bugzilla.gnome.org/show_bug.cgi?id=709183
(4 additional frame(s) were not displayed)
...
  File "__main__.py", line 66, in start
    FIRMWARE_VERSION
  File "/opt/gatewayconfig/gatewayconfig_app.py", line 45, in __init__
    self.shared_state
  File "/opt/gatewayconfig/processors/bluetooth_services_processor.py", line 12, in __init__
    super().__init__()
  File "/opt/lib/cputemp/service.py", line 62, in __init__
    self.mainloop = GObject.MainLoop()
  File "__init__.py", line 69, in __getattr__
    raise AttributeError(_static_binding_error)
@shawaj
Copy link
Member

shawaj commented Jan 5, 2023

We only have:

try:
from gi.repository import GObject
except ImportError:
import gobject as GObject # noqa: F401

And

try:
from gi.repository import GObject
except ImportError:
import gobject as GObject

Which handle both.

So think this issue can be closed

@shawaj shawaj closed this as completed Jan 5, 2023
@shawaj shawaj reopened this Jan 5, 2023
@shawaj
Copy link
Member

shawaj commented Jan 5, 2023

Unless @NebraLtd/developers has a different opinion?

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

No branches or pull requests

1 participant