mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-41025: Fix subclassing for zoneinfo.ZoneInfo (GH-20965)
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
This commit is contained in:
parent
e55de68be3
commit
87d8287865
3 changed files with 5 additions and 3 deletions
|
@ -2557,7 +2557,7 @@ static PyMethodDef zoneinfo_methods[] = {
|
|||
{"_unpickle", (PyCFunction)zoneinfo__unpickle, METH_VARARGS | METH_CLASS,
|
||||
PyDoc_STR("Private method used in unpickling.")},
|
||||
{"__init_subclass__", (PyCFunction)(void (*)(void))zoneinfo_init_subclass,
|
||||
METH_VARARGS | METH_KEYWORDS,
|
||||
METH_VARARGS | METH_KEYWORDS | METH_CLASS,
|
||||
PyDoc_STR("Function to initialize subclasses.")},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue