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

Method close

Lib/shelve.py:140–155  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

138 self.close()
139
140 def close(self):
141 if self.dict is None:
142 return
143 try:
144 self.sync()
145 try:
146 self.dict.close()
147 except AttributeError:
148 pass
149 finally:
150 # Catch errors that may happen when close is called from __del__
151 # because CPython is in interpreter shutdown.
152 try:
153 self.dict = _ClosedDict()
154 except:
155 self.dict = None
156
157 def __del__(self):
158 if not hasattr(self, 'writeback'):

Callers 3

__exit__Method · 0.95
__del__Method · 0.95
test_closeMethod · 0.95

Calls 2

syncMethod · 0.95
_ClosedDictClass · 0.85

Tested by 1

test_closeMethod · 0.76