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 746985 - Remove useless type checking code for field setters
Remove useless type checking code for field setters
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
Git master
Other Linux
: Normal minor
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-29 22:21 UTC by Christoph Reiter (lazka)
Modified: 2015-03-30 09:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Improve-test-coverage-for-field-setters-getters (6.47 KB, patch)
2015-03-29 22:21 UTC, Christoph Reiter (lazka)
committed Details | Review
0002-pygi-argument-Remove-unused-imports-includes (1.72 KB, patch)
2015-03-29 22:21 UTC, Christoph Reiter (lazka)
committed Details | Review
0003-Field-setters-Remove-unneeded-type-range-checks-and- (27.62 KB, patch)
2015-03-29 22:22 UTC, Christoph Reiter (lazka)
committed Details | Review

Description Christoph Reiter (lazka) 2015-03-29 22:21:08 UTC
I noticed that _pygi_g_type_info_check_object() was largely untested and not useful (without it all tests still pass) and only used for field setters. This adds some tests to make sure nothing breaks and removes _pygi_g_type_info_check_object() and all the code that goes with it.

The only known downside of this change is that on int range errors the field setters now raise OverflowError (like everywhere else) instead of ValueError.

Also datetime was imported for some reason but not used.
Comment 1 Christoph Reiter (lazka) 2015-03-29 22:21:30 UTC
Created attachment 300551 [details] [review]
0001-Improve-test-coverage-for-field-setters-getters
Comment 2 Christoph Reiter (lazka) 2015-03-29 22:21:50 UTC
Created attachment 300552 [details] [review]
0002-pygi-argument-Remove-unused-imports-includes
Comment 3 Christoph Reiter (lazka) 2015-03-29 22:22:19 UTC
Created attachment 300553 [details] [review]
0003-Field-setters-Remove-unneeded-type-range-checks-and-
Comment 4 Simon Feltman 2015-03-29 23:44:47 UTC
Review of attachment 300551 [details] [review]:

Looks good, please add a bugzilla url as the last line of the commit message.

::: tests/test_fields.py
@@ +171,3 @@
+        s = GIMarshallingTests.NestedStruct()
+
+        # FIXME: segfaults

Is there a bug logged for this crash? Would be nice to have a URL as part of the comment.
Comment 5 Simon Feltman 2015-03-29 23:45:05 UTC
Review of attachment 300552 [details] [review]:

Sure
Comment 6 Simon Feltman 2015-03-29 23:59:36 UTC
Review of attachment 300553 [details] [review]:

good riddance! thanks lazka.
Comment 7 Christoph Reiter (lazka) 2015-03-30 09:20:56 UTC
(In reply to Simon Feltman from comment #4)
> Review of attachment 300551 [details] [review] [review]:
> 
> Looks good, please add a bugzilla url as the last line of the commit message.
> 
> ::: tests/test_fields.py
> @@ +171,3 @@
> +        s = GIMarshallingTests.NestedStruct()
> +
> +        # FIXME: segfaults
> 
> Is there a bug logged for this crash? Would be nice to have a URL as part of
> the comment.

Pushed with an URL to bug 747002

(In reply to Simon Feltman from comment #6)
> Review of attachment 300553 [details] [review] [review]:
> 
> good riddance! thanks lazka.

Thanks for the review!