Skip to content

Commit d03fda7

Browse files
author
Giovanni Siragusa
committed
Revert "Safely decode if the input or the buffer is None."
This reverts commit 74e239d.
1 parent 427c670 commit d03fda7

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Lib/codecs.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,7 @@ def _buffer_decode(self, input, errors, final):
321321

322322
def decode(self, input, final=False):
323323
# decode input (taking the buffer into account)
324-
data = b''
325-
if input is not None:
326-
data += input
327-
328-
if self.buffer is not None:
329-
data += self.buffer
330-
324+
data = self.buffer + input
331325
(result, consumed) = self._buffer_decode(data, self.errors, final)
332326
# keep undecoded input until the next call
333327
self.buffer = data[consumed:]

0 commit comments

Comments
 (0)