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

Function repl

Lib/posixpath.py:317–331  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

315 environ = os.environ
316
317 def repl(m):
318 name = m[1]
319 if name.startswith(start):
320 if not name.endswith(end):
321 return m[0]
322 name = name[1:-1]
323 try:
324 if environ is None:
325 value = os.fsencode(os.environ[os.fsdecode(name)])
326 else:
327 value = environ[name]
328 except KeyError:
329 return m[0]
330 else:
331 return value
332
333 return sub(repl, path)
334

Callers

nothing calls this directly

Calls 4

fsencodeMethod · 0.80
fsdecodeMethod · 0.80
startswithMethod · 0.45
endswithMethod · 0.45

Tested by

no test coverage detected