Skip to content

Commit 563405c

Browse files
authored
Merge pull request #31 from cs50/develop
2.2.0
2 parents 3f81ff6 + c9f3e85 commit 563405c

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
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
)

src/cs50/cs50.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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

tests/python2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import sys
2+
3+
sys.path.insert(0, "../src")
4+
15
import cs50
26

37
l = cs50.get_long()

tests/python3.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import sys
2+
3+
sys.path.insert(0, "../src")
4+
15
import cs50
26

37
i = cs50.get_int()

tests/sqltests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import unittest
44
import warnings
55

6+
sys.path.insert(0, "../src")
7+
68
from cs50.sql import SQL
79

810
class SQLTests(unittest.TestCase):

0 commit comments

Comments
 (0)