Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.2.0 #31

Merged
merged 3 commits into from
Jul 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -16,5 +16,5 @@
package_dir={"": "src"},
packages=["cs50"],
url="https://github.com/cs50/python-cs50",
version="2.1.1"
version="2.2.0"
)
5 changes: 4 additions & 1 deletion src/cs50/cs50.py
Original file line number Diff line number Diff line change
@@ -117,7 +117,8 @@ def get_string(prompt=None):
Read a line of text from standard input and return it as a string,
sans trailing line ending. Supports CR (\r), LF (\n), and CRLF (\r\n)
as line endings. If user inputs only a line ending, returns "", not None.
Returns None upon error or no input whatsoever (i.e., just EOF).
Returns None upon error or no input whatsoever (i.e., just EOF). Exits
from Python altogether on SIGINT.
"""
try:
if prompt is not None:
@@ -126,5 +127,7 @@ def get_string(prompt=None):
if not s:
return None
return re.sub(r"(?:\r|\r\n|\n)$", "", s)
except KeyboardInterrupt:
sys.exit("")
except ValueError:
return None
4 changes: 4 additions & 0 deletions tests/python2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import sys

sys.path.insert(0, "../src")

import cs50

l = cs50.get_long()
4 changes: 4 additions & 0 deletions tests/python3.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import sys

sys.path.insert(0, "../src")

import cs50

i = cs50.get_int()
2 changes: 2 additions & 0 deletions tests/sqltests.py
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@
import unittest
import warnings

sys.path.insert(0, "../src")

from cs50.sql import SQL

class SQLTests(unittest.TestCase):