MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / populate_flags

Function populate_flags

tools/python-3.11.9-amd64/Tools/scripts/pathfix.py:196–211  ·  view source on GitHub ↗
(shebangline)

Source from the content-addressed store, hash-verified

194
195
196def populate_flags(shebangline):
197 old_flags = b''
198 if keep_flags:
199 old_flags = parse_shebang(shebangline)
200 if old_flags:
201 old_flags = old_flags[2:]
202 if not (old_flags or add_flags):
203 return b''
204 # On Linux, the entire string following the interpreter name
205 # is passed as a single argument to the interpreter.
206 # e.g. "#! /usr/bin/python3 -W Error -s" runs "/usr/bin/python3 "-W Error -s"
207 # so shebang should have single '-' where flags are given and
208 # flag might need argument for that reasons adding new flags is
209 # between '-' and original flags
210 # e.g. #! /usr/bin/python3 -sW Error
211 return b' -' + add_flags + old_flags
212
213
214def fixline(line):

Callers 1

fixlineFunction · 0.85

Calls 1

parse_shebangFunction · 0.85

Tested by

no test coverage detected