Skip to content

Commit 7fa8a7a

Browse files
committed
shlex.quote: Move comment above if statement
1 parent e3d9b05 commit 7fa8a7a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/shlex.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ def quote(s, *, force=False):
333333
safe_chars = (b'%+,-./0123456789:=@'
334334
b'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'
335335
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`.
336338
if (not force
337339
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`.
340340
return s
341341

342342
# use single quotes, and put single quotes into double quotes

0 commit comments

Comments
 (0)