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

Method close_intelligently

src/click/utils.py:184–189  ·  view source on GitHub ↗

This function only closes the file if it was opened by the lazy file wrapper. For instance this will never close stdin.

(self)

Source from the content-addressed store, hash-verified

182 self._f.close()
183
184 def close_intelligently(self) -> None:
185 """This function only closes the file if it was opened by the lazy
186 file wrapper. For instance this will never close stdin.
187 """
188 if self.should_close:
189 self.close()
190
191 def __enter__(self) -> LazyFile:
192 return self

Callers 1

__exit__Method · 0.95

Calls 1

closeMethod · 0.95

Tested by

no test coverage detected