MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __getattr__

Function __getattr__

tools/python-3.11.9-amd64/Lib/io.py:61–74  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

59
60
61def __getattr__(name):
62 if name == "OpenWrapper":
63 # bpo-43680: Until Python 3.9, _pyio.open was not a static method and
64 # builtins.open was set to OpenWrapper to not become a bound method
65 # when set to a class variable. _io.open is a built-in function whereas
66 # _pyio.open is a Python function. In Python 3.10, _pyio.open() is now
67 # a static method, and builtins.open() is now io.open().
68 import warnings
69 warnings.warn('OpenWrapper is deprecated, use open instead',
70 DeprecationWarning, stacklevel=2)
71 global OpenWrapper
72 OpenWrapper = open
73 return OpenWrapper
74 raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
75
76
77# Pretend this exception was created here.

Callers

nothing calls this directly

Calls 1

warnMethod · 0.45

Tested by

no test coverage detected