All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Lautrbach <plautrba@redhat.com>
To: selinux@vger.kernel.org
Cc: Petr Lautrbach <plautrba@redhat.com>
Subject: [PATCH] dbus: Use GLib.MainLoop()
Date: Wed, 28 Jul 2021 18:59:22 +0200	[thread overview]
Message-ID: <20210728165922.186631-1-plautrba@redhat.com> (raw)

Fixes:
    PyGIDeprecationWarning: GObject.MainLoop is deprecated; use GLib.MainLoop instead

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 dbus/selinux_server.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/dbus/selinux_server.py b/dbus/selinux_server.py
index b7c9378bcb5d..a969f2268ceb 100644
--- a/dbus/selinux_server.py
+++ b/dbus/selinux_server.py
@@ -2,8 +2,9 @@
 
 import dbus
 import dbus.service
-import dbus.mainloop.glib
+from dbus.mainloop.glib import DBusGMainLoop
 from gi.repository import GObject
+from gi.repository import GLib
 import os
 import selinux
 from subprocess import Popen, PIPE, STDOUT
@@ -145,9 +146,10 @@ class selinux_server(dbus.service.Object):
         raise ValueError("%s does not exist" % path)
 
 if __name__ == "__main__":
-    mainloop = GObject.MainLoop()
-    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+    DBusGMainLoop(set_as_default=True)
+    mainloop = GLib.MainLoop()
+
     system_bus = dbus.SystemBus()
     name = dbus.service.BusName("org.selinux", system_bus)
-    object = selinux_server(system_bus, "/org/selinux/object")
+    server = selinux_server(system_bus, "/org/selinux/object")
     mainloop.run()
-- 
2.32.0


             reply	other threads:[~2021-07-28 16:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 16:59 Petr Lautrbach [this message]
2021-07-30 14:22 ` [PATCH] dbus: Use GLib.MainLoop() James Carter
2021-08-03 14:04   ` James Carter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210728165922.186631-1-plautrba@redhat.com \
    --to=plautrba@redhat.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.