mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-41025: Fix subclassing for zoneinfo.ZoneInfo (GH-20965) (GH-21876)
Prior to this change, attempting to subclass the C implementation of
zoneinfo.ZoneInfo gave the following error:
TypeError: unbound method ZoneInfo.__init_subclass__() needs an argument
https://bugs.python.org/issue41025
(cherry picked from commit 87d8287865
)
Co-authored-by: Paul Ganssle <paul@ganssle.io>
This commit is contained in:
parent
7c288413db
commit
33d3c64095
3 changed files with 5 additions and 3 deletions
|
@ -462,7 +462,7 @@ class CZoneInfoDatetimeSubclassTest(DatetimeSubclassMixin, CZoneInfoTest):
|
|||
pass
|
||||
|
||||
|
||||
class ZoneInfoTestSubclass(ZoneInfoTest):
|
||||
class ZoneInfoSubclassTest(ZoneInfoTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
|
@ -483,7 +483,7 @@ class ZoneInfoTestSubclass(ZoneInfoTest):
|
|||
self.assertIsInstance(sub_obj, self.klass)
|
||||
|
||||
|
||||
class CZoneInfoTestSubclass(ZoneInfoTest):
|
||||
class CZoneInfoSubclassTest(ZoneInfoSubclassTest):
|
||||
module = c_zoneinfo
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue