astimezone() internals: if utcoffset() returns a duration, complain if
dst() returns None (instead of treating that as 0).
diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c
index 3719a77..96c3e6d 100644
--- a/Modules/datetimemodule.c
+++ b/Modules/datetimemodule.c
@@ -4805,7 +4805,11 @@
resdst = call_dst(tzinfo, result, &none);
if (resdst == -1 && PyErr_Occurred())
goto Fail;
- /* None and 0 dst() results are the same to us here. Debatable. */
+ if (none) {
+ PyErr_SetString(PyExc_ValueError, "astimezone(): utcoffset() "
+ "returned a duration but dst() returned None");
+ goto Fail;
+ }
total_added_to_result = resoff - resdst - selfoff;
if (total_added_to_result != 0) {
mm += total_added_to_result;