@@ -1975,30 +1975,30 @@ class AsyncContextManager(Generic[T_co],
19751975 __slots__ = ()
19761976
19771977 __all__ .append ('AsyncContextManager' )
1978- # elif sys.version_info[:2] >= (3, 5):
1979- # exec("""
1980- # class AsyncContextManager(Generic[T_co]):
1981- # __slots__ = ()
1982- #
1983- # async def __aenter__(self):
1984- # return self
1985- #
1986- # @abc.abstractmethod
1987- # async def __aexit__(self, exc_type, exc_value, traceback):
1988- # return None
1989- #
1990- # @classmethod
1991- # def __subclasshook__(cls, C):
1992- # if cls is AsyncContextManager:
1993- # if sys.version_info[:2] >= (3, 6):
1994- # return _collections_abc._check_methods(C, "__aenter__", "__aexit__")
1995- # if (any("__aenter__" in B.__dict__ for B in C.__mro__) and
1996- # any("__aexit__" in B.__dict__ for B in C.__mro__)):
1997- # return True
1998- # return NotImplemented
1999- #
2000- # __all__.append('AsyncContextManager')
2001- # """)
1978+ elif sys .version_info [:2 ] >= (3 , 5 ):
1979+ exec ("""
1980+ class AsyncContextManager(Generic[T_co]):
1981+ __slots__ = ()
1982+
1983+ async def __aenter__(self):
1984+ return self
1985+
1986+ @abc.abstractmethod
1987+ async def __aexit__(self, exc_type, exc_value, traceback):
1988+ return None
1989+
1990+ @classmethod
1991+ def __subclasshook__(cls, C):
1992+ if cls is AsyncContextManager:
1993+ if sys.version_info[:2] >= (3, 6):
1994+ return _collections_abc._check_methods(C, "__aenter__", "__aexit__")
1995+ if (any("__aenter__" in B.__dict__ for B in C.__mro__) and
1996+ any("__aexit__" in B.__dict__ for B in C.__mro__)):
1997+ return True
1998+ return NotImplemented
1999+
2000+ __all__.append('AsyncContextManager')
2001+ """ )
20022002
20032003
20042004class Dict (dict , MutableMapping [KT , VT ], extra = dict ):
0 commit comments