File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 5555__all__ = ["LocalRuntime" , "BashSession" ]
5656
5757
58- def _split_bash_command (inpt : str ) -> list [str ]:
58+ def _split_bash_command (input : str ) -> list [str ]:
5959 r"""Split a bash command with linebreaks, escaped newlines, and heredocs into a list of
6060 individual commands.
6161
6262 Args:
63- inpt : The input string to split into commands.
63+ input : The input string to split into commands.
6464 Returns:
6565 A list of commands as strings.
6666
@@ -70,11 +70,11 @@ def _split_bash_command(inpt: str) -> list[str]:
7070 "cmd1\\\n asdf" is one command (because the linebreak is escaped)
7171 "cmd1<<EOF\na\nb\nEOF" is one command (because of the heredoc)
7272 """
73- inpt = inpt .strip ()
74- if not inpt or all (l .strip ().startswith ("#" ) for l in inpt .splitlines ()):
73+ input = input .strip ()
74+ if not input or all (l .strip ().startswith ("#" ) for l in input .splitlines ()):
7575 # bashlex can't deal with empty strings or the like :/
7676 return []
77- parsed = bashlex .parse (inpt )
77+ parsed = bashlex .parse (input )
7878 cmd_strings = []
7979
8080 def find_range (cmd : bashlex .ast .node ) -> tuple [int , int ]:
@@ -88,7 +88,7 @@ def find_range(cmd: bashlex.ast.node) -> tuple[int, int]:
8888
8989 for cmd in parsed :
9090 start , end = find_range (cmd )
91- cmd_strings .append (inpt [start :end ])
91+ cmd_strings .append (input [start :end ])
9292 return cmd_strings
9393
9494
You can’t perform that action at this time.
0 commit comments