After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 620906 - Allow passing None for callbacks which are annotated allow-none
Allow passing None for callbacks which are annotated allow-none
Status: RESOLVED FIXED
Product: pygi
Classification: Deprecated
Component: general
unspecified
Other All
: Normal normal
: 0.6
Assigned To: pygi-maint
pygi-maint
Depends on:
Blocks:
 
 
Reported: 2010-06-07 21:16 UTC by johnp
Modified: 2010-06-14 17:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow passing None for callbacks which are annotated allow-none (4.30 KB, patch)
2010-06-07 21:16 UTC, johnp
reviewed Details | Review

Description johnp 2010-06-07 21:16:29 UTC
* Many callbacks are optional parameters yet we were asserting on
  Py_None
* We now check to see if allow_none is set when setting up callbacks,
  if it is set and py_function == Py_None, we set the closure to NULL
  and return
* pygi-invoke.c now checks to see if the closure == NULL when setting
  arguments
* if it is NULL there is no reason to set the the destroy notify handler
  so we skip that too
Comment 1 johnp 2010-06-07 21:16:30 UTC
Created attachment 162975 [details] [review]
Allow passing None for callbacks which are annotated allow-none
Comment 2 Zach Goldberg 2010-06-13 17:12:17 UTC
Review of attachment 162975 [details] [review]:

I like it.