File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 1616 package_dir = {"" : "src" },
1717 packages = ["cs50" ],
1818 url = "https://github.com/cs50/python-cs50" ,
19- version = "2.1.1 "
19+ version = "2.2.0 "
2020)
Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ def get_string(prompt=None):
117117 Read a line of text from standard input and return it as a string,
118118 sans trailing line ending. Supports CR (\r ), LF (\n ), and CRLF (\r \n )
119119 as line endings. If user inputs only a line ending, returns "", not None.
120- Returns None upon error or no input whatsoever (i.e., just EOF).
120+ Returns None upon error or no input whatsoever (i.e., just EOF). Exits
121+ from Python altogether on SIGINT.
121122 """
122123 try :
123124 if prompt is not None :
@@ -126,5 +127,7 @@ def get_string(prompt=None):
126127 if not s :
127128 return None
128129 return re .sub (r"(?:\r|\r\n|\n)$" , "" , s )
130+ except KeyboardInterrupt :
131+ sys .exit ("" )
129132 except ValueError :
130133 return None
You can’t perform that action at this time.
0 commit comments