[pygobject] Add backwards compatible API for GLib.unix_signal_add_full()
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Add backwards compatible API for GLib.unix_signal_add_full()
- Date: Wed, 28 Nov 2012 11:21:26 +0000 (UTC)
commit e45c690bc83b6d513887649de88965a9752e316d
Author: Martin Pitt <martinpitt gnome org>
Date: Wed Nov 28 12:20:31 2012 +0100
Add backwards compatible API for GLib.unix_signal_add_full()
This was renamed to GLib.unix_signal_add() in
http://git.gnome.org/browse/glib/commit/?id=fca30c3e165
Provide a backwards compatible shim with a deprecation message.
gi/overrides/GLib.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gi/overrides/GLib.py b/gi/overrides/GLib.py
index dd83f3a..3db43ed 100644
--- a/gi/overrides/GLib.py
+++ b/gi/overrides/GLib.py
@@ -837,6 +837,16 @@ def filename_from_utf8(utf8string, len=-1):
__all__.append('filename_from_utf8')
+# backwards compatible API for renamed function
+if not hasattr(GLib, 'unix_signal_add_full'):
+ def add_full_compat(*args):
+ warnings.warn('GLib.unix_signal_add_full() was renamed to GLib.unix_signal_add()',
+ PyGIDeprecationWarning)
+ return GLib.unix_signal_add(*args)
+
+ GLib.unix_signal_add_full = add_full_compat
+
+
# obsolete constants for backwards compatibility
glib_version = (GLib.MAJOR_VERSION, GLib.MINOR_VERSION, GLib.MICRO_VERSION)
__all__.append('glib_version')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]