Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 2 additions & 7 deletions Lib/quopri.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ def write(s, output=output, lineEnd=b'\n'):
output.write(s + lineEnd)

prevline = None
while 1:
line = input.readline()
if not line:
break
while line := input.readline():
outline = []
# Strip off any readline induced trailing newline
stripped = b''
Expand Down Expand Up @@ -126,9 +123,7 @@ def decode(input, output, header=False):
return

new = b''
while 1:
line = input.readline()
if not line: break
while line := input.readline():
i, n = 0, len(line)
if n > 0 and line[n-1:n] == b'\n':
partial = 0; n = n-1
Expand Down
3 changes: 3 additions & 0 deletions Lib/test/test_quopri.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys, io, subprocess
import quopri

from test import support


ENCSAMPLE = b"""\
Expand Down Expand Up @@ -180,6 +181,7 @@ def test_decode_header(self):
for p, e in self.HSTRINGS:
self.assertEqual(quopri.decodestring(e, header=True), p)

@support.requires_subprocess()
def test_scriptencode(self):
(p, e) = self.STRINGS[-1]
process = subprocess.Popen([sys.executable, "-mquopri"],
Expand All @@ -196,6 +198,7 @@ def test_scriptencode(self):
self.assertEqual(cout[i], e[i])
self.assertEqual(cout, e)

@support.requires_subprocess()
def test_scriptdecode(self):
(p, e) = self.STRINGS[-1]
process = subprocess.Popen([sys.executable, "-mquopri", "-d"],
Expand Down
Loading