MCPcopy Create free account
hub / github.com/ipython/ipython / close

Method close

IPython/utils/io.py:134–139  ·  view source on GitHub ↗

Close the file and restore the channel.

(self)

Source from the content-addressed store, hash-verified

132 self._closed = False
133
134 def close(self):
135 """Close the file and restore the channel."""
136 self.flush()
137 setattr(sys, self.channel, self.ostream)
138 self.file.close()
139 self._closed = True
140
141 def write(self, data):
142 """Write data to both channels."""

Callers 15

__del__Method · 0.95
tchanMethod · 0.95
retar.pyFile · 0.45
cleanupMethod · 0.45
setUpClassMethod · 0.45
test_ensure_dir_existsFunction · 0.45
test_target_existsMethod · 0.45
make_empty_fileFunction · 0.45
test_ipython_embedFunction · 0.45
test_nest_embedFunction · 0.45

Calls 1

flushMethod · 0.95

Tested by 15

tchanMethod · 0.76
setUpClassMethod · 0.36
test_ensure_dir_existsFunction · 0.36
test_target_existsMethod · 0.36
make_empty_fileFunction · 0.36
test_ipython_embedFunction · 0.36
test_nest_embedFunction · 0.36
test_xmode_skipFunction · 0.36
test_historyFunction · 0.36