GNOME Bugzilla – Bug 746985
Remove useless type checking code for field setters
Last modified: 2015-03-30 09:20:56 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.
Created attachment 300551 [details] [review] 0001-Improve-test-coverage-for-field-setters-getters
Created attachment 300552 [details] [review] 0002-pygi-argument-Remove-unused-imports-includes
Created attachment 300553 [details] [review] 0003-Field-setters-Remove-unneeded-type-range-checks-and-
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.
Review of attachment 300552 [details] [review]: Sure
Review of attachment 300553 [details] [review]: good riddance! thanks lazka.
(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!