Break the dependency on pyutil, which unnecessarily pulls in all of Twisted.
This changes the semantics of the library somewhat, as different exceptions are raised in some places. Notably, where pyutil's _assert or precondition were used, a ValueError is (usually) raised, instead of AssertionError. Additionally, _assert_valid_lat & _assert_valid_lon raise ValueError instead of TypeError.
While my changes reflect the correct exceptions to raise, they may cause some issues with BC.
Ben and I spoke about this a couple days ago, and we're okay with pushing it, then rolling out a more complex fix (creating new exception types which extend both the old (wrong) exception and the new (correct) one) if customers complain.
Break the dependency on pyutil, which unnecessarily pulls in all of Twisted.
This changes the semantics of the library somewhat, as different exceptions are raised in some places. Notably, where pyutil's
_assert
orprecondition
were used, aValueError
is (usually) raised, instead ofAssertionError
. Additionally,_assert_valid_lat
&_assert_valid_lon
raiseValueError
instead ofTypeError
.While my changes reflect the correct exceptions to raise, they may cause some issues with BC.
Ben and I spoke about this a couple days ago, and we're okay with pushing it, then rolling out a more complex fix (creating new exception types which extend both the old (wrong) exception and the new (correct) one) if customers complain.