MCPcopy Index your code
hub / github.com/RustPython/RustPython / __getattr__

Function __getattr__

Lib/_dummy_os.py:10–19  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

8 import abc, sys
9
10 def __getattr__(name):
11 if name in {"_path_normpath", "__path__"}:
12 raise AttributeError(name)
13 if name.isupper():
14 return 0
15 def dummy(*args, **kwargs):
16 import io
17 return io.UnsupportedOperation(f"{name}: no os specific module found")
18 dummy.__name__ = f"dummy_{name}"
19 return dummy
20
21 sys.modules['os'] = sys.modules['posix'] = sys.modules[__name__]
22

Callers

nothing calls this directly

Calls 1

isupperMethod · 0.45

Tested by

no test coverage detected