From b486edf800ecb9d2e23a35f7ac3151657ee39250 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 24 Jan 2012 16:06:35 +0000 Subject: Deprecate dbus.glib (use dbus.mainloop.glib or dbus.mainloop.qt4) --- dbus/glib.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dbus/glib.py b/dbus/glib.py index 610de53..bb6db74 100644 --- a/dbus/glib.py +++ b/dbus/glib.py @@ -35,7 +35,17 @@ equivalent code:: __docformat__ = 'restructuredtext' from dbus.mainloop.glib import DBusGMainLoop, threads_init +from warnings import warn as _warn init_threads = threads_init DBusGMainLoop(set_as_default=True) + +_warn(DeprecationWarning("""\ +Importing dbus.glib to use the GLib main loop with dbus-python is deprecated. +Instead, use this sequence: + + from dbus.mainloop.glib import DBusGMainLoop + + DBusGMainLoop(set_as_default=True) +"""), DeprecationWarning, stacklevel=2) -- cgit v1.2.1