Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca69f02

Browse files
committed
[Patch #1002763] Allow long ints as terminator values; also, treat a terminator of 0 like the empty string or None
1 parent 5ac2534 commit ca69f02

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/asynchat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ def handle_read (self):
101101
while self.ac_in_buffer:
102102
lb = len(self.ac_in_buffer)
103103
terminator = self.get_terminator()
104-
if terminator is None or terminator == '':
104+
if not terminator:
105105
# no terminator, collect it all
106106
self.collect_incoming_data (self.ac_in_buffer)
107107
self.ac_in_buffer = ''
108-
elif isinstance(terminator, int):
108+
elif isinstance(terminator, int) or isinstance(terminator, long):
109109
# numeric terminator
110110
n = terminator
111111
if lb < n:

0 commit comments

Comments
 (0)