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 540376 - No TypeError raised when type is None
No TypeError raised when type is None
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
unspecified
Other Linux
: Normal minor
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-26 20:38 UTC by Björn Lindqvist
Modified: 2008-08-11 20:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
simple check patch (837 bytes, patch)
2008-08-02 19:40 UTC, Paul Pogonyshev
committed Details | Review

Description Björn Lindqvist 2008-06-26 20:38:00 UTC
AFAICT, the following code ought to raise a TypeError because type is None.

    gobject.signal_new('test',
                       None,
                       0,
                       gobject.TYPE_NONE,
                       (gobject.TYPE_LONG,))

Instead, it prints warnings and raises a RuntimeError which is not quite as good.
Comment 1 Paul Pogonyshev 2008-08-02 19:40:47 UTC
Created attachment 115744 [details] [review]
simple check patch
Comment 2 Johan (not receiving bugmail) Dahlin 2008-08-02 21:36:58 UTC
Comment on attachment 115744 [details] [review]
simple check patch

Misses test.
But the rest looks good, I think.
Comment 3 Paul Pogonyshev 2008-08-11 20:31:19 UTC
Committed the patch and the test above.

Sending        ChangeLog
Sending        gobject/gobjectmodule.c
Sending        tests/test_signal.py
Transmitting file data ...
Committed revision 942.

2008-08-11  Paul Pogonyshev  <pogonyshev@gmx.net>

	Bug 540376 – No TypeError raised when type is None

	* gobject/gobjectmodule.c (pyg_signal_new): Add check on second
	argument type.

	* tests/test_signal.py (TestSignalCreation): New test case.