MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / quote

Function quote

extern/pybind/pybind11/__main__.py:23–29  ·  view source on GitHub ↗
(s: str)

Source from the content-addressed store, hash-verified

21 UNSAFE = re.compile("[ \t\n\r]")
22
23 def quote(s: str) -> str:
24 if s and not UNSAFE.search(s):
25 return s
26
27 # Paths cannot contain a '"' on Windows, so we don't need to worry
28 # about nuanced counting here.
29 return f'"{s}\\"' if s.endswith("\\") else f'"{s}"'
30else:
31
32 def quote(s: str) -> str:

Callers 2

print_includesFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected