File tree 5 files changed +15
-2
lines changed
5 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 16
16
package_dir = {"" : "src" },
17
17
packages = ["cs50" ],
18
18
url = "https://github.com/cs50/python-cs50" ,
19
- version = "2.1.1 "
19
+ version = "2.2.0 "
20
20
)
Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ def get_string(prompt=None):
117
117
Read a line of text from standard input and return it as a string,
118
118
sans trailing line ending. Supports CR (\r ), LF (\n ), and CRLF (\r \n )
119
119
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.
121
122
"""
122
123
try :
123
124
if prompt is not None :
@@ -126,5 +127,7 @@ def get_string(prompt=None):
126
127
if not s :
127
128
return None
128
129
return re .sub (r"(?:\r|\r\n|\n)$" , "" , s )
130
+ except KeyboardInterrupt :
131
+ sys .exit ("" )
129
132
except ValueError :
130
133
return None
Original file line number Diff line number Diff line change
1
+ import sys
2
+
3
+ sys .path .insert (0 , "../src" )
4
+
1
5
import cs50
2
6
3
7
l = cs50 .get_long ()
Original file line number Diff line number Diff line change
1
+ import sys
2
+
3
+ sys .path .insert (0 , "../src" )
4
+
1
5
import cs50
2
6
3
7
i = cs50 .get_int ()
Original file line number Diff line number Diff line change 3
3
import unittest
4
4
import warnings
5
5
6
+ sys .path .insert (0 , "../src" )
7
+
6
8
from cs50 .sql import SQL
7
9
8
10
class SQLTests (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments