Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
pygobject
Commits
9baf3240
Commit
9baf3240
authored
Jan 12, 2011
by
John (J5) Palmieri
Browse files
[gi] handle allow_none for all args
parent
d54d12c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
gi/pygi-cache.c
View file @
9baf3240
...
...
@@ -1000,7 +1000,8 @@ _args_cache_generate(GIFunctionInfo *function_info,
if
(
arg_cache
==
NULL
)
goto
arg_err
;
arg_cache
->
allow_none
=
g_arg_info_may_be_null
(
arg_info
);
function_cache
->
in_args
=
g_slist_append
(
function_cache
->
in_args
,
arg_cache
);
break
;
...
...
gi/pygi-cache.h
View file @
9baf3240
...
...
@@ -48,6 +48,7 @@ struct _PyGIArgCache
gboolean
is_aux
;
gboolean
is_pointer
;
gboolean
is_caller_allocates
;
gboolean
allow_none
;
GIDirection
direction
;
GITransfer
transfer
;
...
...
gi/pygi-invoke.c
View file @
9baf3240
...
...
@@ -986,6 +986,13 @@ _invoke_marshal_in_args(PyGIInvokeState *state, PyGIFunctionCache *cache)
c_arg
=
state
->
args
[
i
];
if
(
arg_cache
->
in_marshaller
!=
NULL
)
{
if
(
!
arg_cache
->
allow_none
&&
py_arg
==
Py_None
)
{
PyErr_Format
(
PyExc_TypeError
,
"Argument %i does not allow None as a value"
,
i
);
return
FALSE
;
}
gboolean
success
=
arg_cache
->
in_marshaller
(
state
,
cache
,
arg_cache
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment