File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change
1
+ import sys
1
2
from collections .abc import Iterable
2
- from typing import TextIO
3
- from typing_extensions import Self
3
+ from typing import TextIO , overload
4
+ from typing_extensions import Self , deprecated
4
5
5
6
__all__ = ["shlex" , "split" , "quote" , "join" ]
6
7
7
- def split (s : str , comments : bool = False , posix : bool = True ) -> list [str ]: ...
8
+ if sys .version_info >= (3 , 12 ):
9
+ def split (s : str | TextIO , comments : bool = False , posix : bool = True ) -> list [str ]: ...
10
+
11
+ else :
12
+ @overload
13
+ def split (s : str | TextIO , comments : bool = False , posix : bool = True ) -> list [str ]: ...
14
+ @overload
15
+ @deprecated ("Passing None for 's' to shlex.split() is deprecated and will raise an error in Python 3.12." )
16
+ def split (s : None , comments : bool = False , posix : bool = True ) -> list [str ]: ...
17
+
8
18
def join (split_command : Iterable [str ]) -> str : ...
9
19
def quote (s : str ) -> str : ...
10
20
You can’t perform that action at this time.
0 commit comments