MCPcopy
hub / github.com/psf/black / _generate_pickle_name

Function _generate_pickle_name

src/blib2to3/pgen2/driver.py:230–238  ·  view source on GitHub ↗
(gt: Path, cache_dir: Path | None = None)

Source from the content-addressed store, hash-verified

228
229
230def _generate_pickle_name(gt: Path, cache_dir: Path | None = None) -> str:
231 head, tail = os.path.splitext(gt)
232 if tail == ".txt":
233 tail = ""
234 name = head + tail + ".".join(map(str, sys.version_info)) + ".pickle"
235 if cache_dir:
236 return os.path.join(cache_dir, os.path.basename(name))
237 else:
238 return name
239
240
241def load_grammar(

Callers 2

load_grammarFunction · 0.85
load_packaged_grammarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected