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

Function repl

Lib/sysconfig/__main__.py:62–94  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

60
61 def resolve_var(name):
62 def repl(m):
63 n = m[1]
64 if n == '$':
65 return '$'
66 elif n == '':
67 # bogus variable reference (e.g. "prefix=$/opt/python")
68 if keep_unresolved:
69 return m[0]
70 raise ValueError
71 elif n[0] == '(' and n[-1] == ')':
72 n = n[1:-1]
73 elif n[0] == '{' and n[-1] == '}':
74 n = n[1:-1]
75
76 if n in done:
77 return str(done[n])
78 elif n in notdone:
79 return str(resolve_var(n))
80 elif n in os.environ:
81 # do it like make: fall back to environment
82 return os.environ[n]
83 elif n in renamed_variables:
84 if name.startswith('PY_') and name[3:] in renamed_variables:
85 return ""
86 n = 'PY_' + n
87 if n in notdone:
88 return str(resolve_var(n))
89 else:
90 assert n not in done
91 return ""
92 else:
93 done[n] = ""
94 return ""
95
96 assert name not in done
97 done[name] = ""

Callers

nothing calls this directly

Calls 3

strFunction · 0.85
resolve_varFunction · 0.85
startswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…