| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -333,10 +333,10 @@ def quote(s, *, force=False): | |||
| 333 | 333 | safe_chars = (b'%+,-./0123456789:=@' | |
| 334 | 334 | b'ABCDEFGHIJKLMNOPQRSTUVWXYZ_' | |
| 335 | 335 | b'abcdefghijklmnopqrstuvwxyz') | |
| 336 | + # No quoting is needed if we are not forcing quoting | ||
| 337 | + # and `s` is an ASCII string consisting only of `safe_chars`. | ||
| 336 | 338 | if (not force | |
| 337 | 339 | and s.isascii() and not s.encode().translate(None, delete=safe_chars)): | |
| 338 | - # No quoting is needed if we are not forcing quoting | ||
| 339 | - # and `s` is an ASCII string consisting only of `safe_chars`. | ||
| 340 | 340 | return s | |
| 341 | 341 | ||
| 342 | 342 | # use single quotes, and put single quotes into double quotes | |
| Back | FazBrowse Home | New Git URL |
0 commit comments