summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Lib/shlex.py
diff options
context:
space:
mode:
authorshadchin <[email protected]>2024-02-12 07:53:52 +0300
committerDaniil Cherednik <[email protected]>2024-02-14 14:26:16 +0000
commit31f2a419764a8ba77c2a970cfc80056c6cd06756 (patch)
treec1995d239eba8571cefc640f6648e1d5dd4ce9e2 /contrib/tools/python3/src/Lib/shlex.py
parentfe2ef02b38d9c85d80060963b265a1df9f38c3bb (diff)
Update Python from 3.11.8 to 3.12.2
Diffstat (limited to 'contrib/tools/python3/src/Lib/shlex.py')
-rw-r--r--contrib/tools/python3/src/Lib/shlex.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/contrib/tools/python3/src/Lib/shlex.py b/contrib/tools/python3/src/Lib/shlex.py
index 4801a6c1d47..f4821616b62 100644
--- a/contrib/tools/python3/src/Lib/shlex.py
+++ b/contrib/tools/python3/src/Lib/shlex.py
@@ -305,9 +305,7 @@ class shlex:
def split(s, comments=False, posix=True):
"""Split the string *s* using shell-like syntax."""
if s is None:
- import warnings
- warnings.warn("Passing None for 's' to shlex.split() is deprecated.",
- DeprecationWarning, stacklevel=2)
+ raise ValueError("s argument must not be None")
lex = shlex(s, posix=posix)
lex.whitespace_split = True
if not comments:
@@ -335,10 +333,7 @@ def quote(s):
def _print_tokens(lexer):
- while 1:
- tt = lexer.get_token()
- if not tt:
- break
+ while tt := lexer.get_token():
print("Token: " + repr(tt))
if __name__ == '__main__':