]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40549: posixmodule.c uses defining_class (GH-20075)
authorVictor Stinner <vstinner@python.org>
Thu, 14 May 2020 16:05:58 +0000 (18:05 +0200)
committerGitHub <noreply@github.com>
Thu, 14 May 2020 16:05:58 +0000 (18:05 +0200)
commit97f33c35445e6d67df24dcbafef7b78333feb778
tree27e0536659d9176e02e0a7a549d3f397fdf91fa1
parente77d428856fbd339faee44ff47214eda5fb51d57
bpo-40549: posixmodule.c uses defining_class (GH-20075)

Pass PEP 573 defining_class to os.DirEntry methods. The module state
is now retrieve from defining_class rather than Py_TYPE(self), to
support subclasses (even if DirEntry doesn't support subclasses yet).

* Pass the module rather than defining_class to DirEntry_fetch_stat().
* Only get the module state once in _posix_clear(),
  _posix_traverse() and _posixmodule_exec().
Modules/clinic/posixmodule.c.h
Modules/posixmodule.c