Skip to content

Commit d756211

Browse files
committed
Only strip trailing whitespaces
1 parent 830a4e2 commit d756211

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/sqlite3/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def runsource(self, source, filename="<input>", symbol="single"):
4848
Return True if more input is needed; buffering is done automatically.
4949
Return False if input is a complete statement ready for execution.
5050
"""
51-
source = source.strip()
51+
source = source.rstrip()
5252
match source:
5353
case ".version":
5454
print(f"{sqlite3.sqlite_version}")

Lib/test/test_sqlite3/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def test_interact_version(self):
111111
self.assertIn(sqlite3.sqlite_version, out)
112112

113113
def test_interact_whitespace_stripping(self):
114-
out, err = self.run_cli(commands=(" " + ".version" + " ",))
114+
out, err = self.run_cli(commands=(".version" + " ",))
115115
self.assertIn(self.MEMORY_DB_MSG, err)
116116
self.assertIn(sqlite3.sqlite_version + "\n", out)
117117
self.assertEndsWith(out, self.PS1)

0 commit comments

Comments
 (0)