diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2019-01-18 18:40:35 +0100 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2019-01-18 18:40:35 +0100 |
commit | 59538e6b256b3ccd6bcaf42f02c151f2fcf23535 (patch) | |
tree | fb2bccd87a53e1453161460839804704a57ad804 /gi | |
parent | f122922276bfee0c01141c1ce6690d11399f6f1a (diff) | |
download | pygobject-59538e6b256b3ccd6bcaf42f02c151f2fcf23535.tar.gz |
GObject.Value: deprecate calling get/set_boxed on a non-boxed value
This wasn't documented but worked in most cases. Make sure no-one is depending
on it in the long run.
Diffstat (limited to 'gi')
-rw-r--r-- | gi/overrides/GObject.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gi/overrides/GObject.py b/gi/overrides/GObject.py index 938a19a8..4cc08a9a 100644 --- a/gi/overrides/GObject.py +++ b/gi/overrides/GObject.py @@ -210,12 +210,18 @@ class Value(GObjectModule.Value): self.set_value(py_value) def set_boxed(self, boxed): + if not self.g_type.is_a(TYPE_BOXED): + warnings.warn('Calling set_boxed() on a non-boxed type deprecated', + PyGIDeprecationWarning, stacklevel=2) # Workaround the introspection marshalers inability to know # these methods should be marshaling boxed types. This is because # the type information is stored on the GValue. _gi._gvalue_set(self, boxed) def get_boxed(self): + if not self.g_type.is_a(TYPE_BOXED): + warnings.warn('Calling get_boxed() on a non-boxed type deprecated', + PyGIDeprecationWarning, stacklevel=2) return _gi._gvalue_get(self) def set_value(self, py_value): |