bpo-39481: Make os.DirEntry generic (GH-19415)

This commit is contained in:
Batuhan Taşkaya 2020-04-08 00:37:19 +03:00 committed by GitHub
parent 87255be696
commit f9dd51e7db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -7,6 +7,7 @@ from collections import (
)
from collections.abc import *
from contextlib import AbstractContextManager, AbstractAsyncContextManager
from os import DirEntry
from re import Pattern, Match
from types import GenericAlias, MappingProxyType
import typing
@ -34,7 +35,7 @@ class BaseTest(unittest.TestCase):
Mapping, MutableMapping, MappingView,
KeysView, ItemsView, ValuesView,
Sequence, MutableSequence,
MappingProxyType,
MappingProxyType, DirEntry
):
tname = t.__name__
with self.subTest(f"Testing {tname}"):

View File

@ -12976,6 +12976,8 @@ static PyMethodDef DirEntry_methods[] = {
OS_DIRENTRY_STAT_METHODDEF
OS_DIRENTRY_INODE_METHODDEF
OS_DIRENTRY___FSPATH___METHODDEF
{"__class_getitem__", (PyCFunction)Py_GenericAlias,
METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
{NULL}
};