summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2012-05-05 22:55:57 +0200
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2012-05-05 22:55:57 +0200
commitec23b2345515e4bbf91f07477950fd89f4ba71b6 (patch)
treec04182c346c8fe6a78c767241c373d6673e6e851 /bindings
parentb35fc7fffba107332ea8c29d1c98d2fb2f0dc97b (diff)
downloadlasso-ec23b2345515e4bbf91f07477950fd89f4ba71b6.tar.gz
lasso-ec23b2345515e4bbf91f07477950fd89f4ba71b6.tar.xz
lasso-ec23b2345515e4bbf91f07477950fd89f4ba71b6.zip
[bindings] add a default parameter to is_transfer_full whose default is False
Diffstat (limited to 'bindings')
-rw-r--r--bindings/utils.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/bindings/utils.py b/bindings/utils.py
index ef55d1b3..a916e778 100644
--- a/bindings/utils.py
+++ b/bindings/utils.py
@@ -258,14 +258,15 @@ def is_int(arg, binding_data):
def is_time_t_pointer(arg):
return re.match(r'\btime_t\*', unconstify(arg_type(arg)))
-def is_transfer_full(arg):
+def is_transfer_full(arg, default=False):
if not isinstance(arg, tuple):
- return False
+ return default
transfer = arg[2].get('transfer')
if transfer:
return transfer == 'full'
- else:
- return is_out(arg) or is_object(arg)
+ if is_cstring(arg) and is_const(arg):
+ return False
+ return default or is_out(arg) or is_object(arg)
_not_objects = ( 'GHashTable', 'GList', 'GType' )