(s: str)
| 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}"' |
| 30 | else: |
| 31 | |
| 32 | def quote(s: str) -> str: |
no outgoing calls
no test coverage detected