summaryrefslogtreecommitdiff
path: root/gi/overrides
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-11-21 23:22:18 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-11-21 23:44:04 +0100
commit9803907e48672b6b16ab16ec864b1df0375bc4f6 (patch)
tree9f7bad50ad7bebe4f19c6a51e2f9fc23f264c736 /gi/overrides
parent66161778dfac3ad7a075a22052482c7593efe0bc (diff)
downloadpygobject-9803907e48672b6b16ab16ec864b1df0375bc4f6.tar.gz
variant: fix __bool__ for maybe types
For other types it is equal to bool of the unpacked type. Do the same for maybe types.
Diffstat (limited to 'gi/overrides')
-rw-r--r--gi/overrides/GLib.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/gi/overrides/GLib.py b/gi/overrides/GLib.py
index 650d6bd8..e0ac233c 100644
--- a/gi/overrides/GLib.py
+++ b/gi/overrides/GLib.py
@@ -384,11 +384,8 @@ class Variant(GLib.Variant):
# Array, dict, tuple
if self.get_type_string().startswith('a') or self.get_type_string().startswith('('):
return self.n_children() != 0
- if self.get_type_string() in ['v']:
- # unpack works recursively, hence bool also works recursively
- return bool(self.unpack())
- # Everything else is True
- return True
+ # unpack works recursively, hence bool also works recursively
+ return bool(self.unpack())
def keys(self):
if not self.get_type_string().startswith('a{'):