astimezone() internals:  if utcoffset() returns a duration, complain if
dst() returns None (instead of treating that as 0).
diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py
index 4fe2ad2..29f81f1 100644
--- a/Lib/test/test_datetime.py
+++ b/Lib/test/test_datetime.py
@@ -2591,6 +2591,8 @@
     dston = datetimetz(2002, 4, 7, 2)
     dstoff = datetimetz(2002, 10, 27, 2)
 
+    theclass = datetimetz
+
     # Check a time that's inside DST.
     def checkinside(self, dt, tz, utc, dston, dstoff):
         self.assertEqual(dt.dst(), HOUR)
@@ -2729,6 +2731,21 @@
         got = sixutc.astimezone(Eastern).astimezone(None)
         self.assertEqual(expected, got)
 
+    def test_bogus_dst(self):
+        class ok(tzinfo):
+            def utcoffset(self, dt): return HOUR
+            def dst(self, dt): return HOUR
+
+        now = self.theclass.now().replace(tzinfo=utc_real)
+        # Doesn't blow up.
+        now.astimezone(ok())
+
+        # Does blow up.
+        class notok(ok):
+            def dst(self, dt): return None
+        self.assertRaises(ValueError, now.astimezone, notok())
+
+
 def test_suite():
     allsuites = [unittest.makeSuite(klass, 'test')
                  for klass in (TestModule,