MCPcopy Index your code
hub / github.com/python/cpython / _create

Method _create

Lib/dbm/dumb.py:72–88  ·  view source on GitHub ↗
(self, flag)

Source from the content-addressed store, hash-verified

70 self._update(flag)
71
72 def _create(self, flag):
73 if flag == 'n':
74 for filename in (self._datfile, self._bakfile, self._dirfile):
75 try:
76 _os.remove(filename)
77 except OSError:
78 pass
79 # Mod by Jack: create data file if needed
80 try:
81 f = _io.open(self._datfile, 'r', encoding="Latin-1")
82 except OSError:
83 if flag not in ('c', 'n'):
84 raise
85 with _io.open(self._datfile, 'w', encoding="Latin-1") as f:
86 self._chmod(self._datfile)
87 else:
88 f.close()
89
90 # Read directory file into the in-memory index dict.
91 def _update(self, flag):

Callers 1

__init__Method · 0.95

Calls 4

_chmodMethod · 0.95
removeMethod · 0.45
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected