MCPcopy
hub / github.com/pallets/click / func

Function func

src/click/_compat.py:589–606  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

587 cache: cabc.MutableMapping[t.TextIO, t.TextIO] = WeakKeyDictionary()
588
589 def func() -> t.TextIO | None:
590 stream = src_func()
591
592 if stream is None:
593 return None
594
595 try:
596 rv = cache.get(stream)
597 except Exception:
598 rv = None
599 if rv is not None:
600 return rv
601 rv = wrapper_func()
602 try:
603 cache[stream] = rv
604 except Exception:
605 pass
606 return rv
607
608 return func
609

Callers 4

getcharFunction · 0.85
wrapperFunction · 0.85
_readline_promptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected