MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / close

Method close

gridfs/synchronous/grid_file.py:1756–1764  ·  view source on GitHub ↗

Make GridOut more generically file-like.

(self)

Source from the content-addressed store, hash-verified

1754 return self
1755
1756 def close(self) -> None:
1757 """Make GridOut more generically file-like."""
1758 if self._chunk_iter:
1759 self._chunk_iter.close()
1760 self._chunk_iter = None
1761 if _IS_SYNC:
1762 super().close()
1763 else:
1764 self.closed = True
1765
1766 def write(self, value: Any) -> NoReturn:
1767 raise io.UnsupportedOperation("write")

Callers 2

__exit__Method · 0.95
test_closedMethod · 0.95

Calls 1

closeMethod · 0.45

Tested by 1

test_closedMethod · 0.76