summaryrefslogtreecommitdiff
path: root/Lib/asynchat.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2005-06-09 14:59:45 +0000
committerAndrew M. Kuchling <amk@amk.ca>2005-06-09 14:59:45 +0000
commit046b019407b1d0b911531e5852296675c17d74f4 (patch)
tree2e0eee542db46f28f95c3ccdab808a00f86ecb5d /Lib/asynchat.py
parent2f4092be066bab29244a7592c29a36653d8d2cbd (diff)
downloadcpython-046b019407b1d0b911531e5852296675c17d74f4.tar.gz
[Patch #1002763] Allow long ints as terminator values; also, treat a terminator of 0 like the empty string or None
Diffstat (limited to 'Lib/asynchat.py')
-rw-r--r--Lib/asynchat.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/asynchat.py b/Lib/asynchat.py
index 28b89a2bde..6f99ba1063 100644
--- a/Lib/asynchat.py
+++ b/Lib/asynchat.py
@@ -101,11 +101,11 @@ class async_chat (asyncore.dispatcher):
while self.ac_in_buffer:
lb = len(self.ac_in_buffer)
terminator = self.get_terminator()
- if terminator is None or terminator == '':
+ if not terminator:
# no terminator, collect it all
self.collect_incoming_data (self.ac_in_buffer)
self.ac_in_buffer = ''
- elif isinstance(terminator, int):
+ elif isinstance(terminator, int) or isinstance(terminator, long):
# numeric terminator
n = terminator
if lb < n: