mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
gh-94352: shlex.split() no longer accepts None (#94353)
shlex.split(): Passing None for s argument now raises an exception, rather than reading sys.stdin. The feature was deprecated in Python 3.9.
This commit is contained in:
parent
670f7f10cf
commit
fbcee570d1
5 changed files with 14 additions and 9 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue