@@ -3059,11 +3059,13 @@ def _readline(self):
30593059 ret , sep , self .read_buf = self .read_buf .partition (b"\n " )
30603060 return ret + sep
30613061
3062- def read_command (self , prompt ):
3063- self .multiline_block = False
3062+ def read_input (self , prompt , multiline_block ):
3063+ self .multiline_block = multiline_block
30643064 with self ._sigint_raises_keyboard_interrupt ():
3065- reply = input (prompt )
3065+ return input (prompt )
30663066
3067+ def read_command (self , prompt ):
3068+ reply = self .read_input (prompt , multiline_block = False )
30673069 if self .state == "dumb" :
30683070 # No logic applied whatsoever, just pass the raw reply back.
30693071 return reply
@@ -3086,11 +3088,9 @@ def read_command(self, prompt):
30863088 return prefix + reply
30873089
30883090 # Otherwise, valid first line of a multi-line statement
3089- self .multiline_block = True
3090- continue_prompt = "..." .ljust (len (prompt ))
3091+ more_prompt = "..." .ljust (len (prompt ))
30913092 while codeop .compile_command (reply , "<stdin>" , "single" ) is None :
3092- with self ._sigint_raises_keyboard_interrupt ():
3093- reply += "\n " + input (continue_prompt )
3093+ reply += "\n " + self .read_input (more_prompt , multiline_block = True )
30943094
30953095 return prefix + reply
30963096
0 commit comments