From: Andrew M. Kuchling Date: Thu, 9 Jun 2005 14:59:45 +0000 (+0000) Subject: [Patch #1002763] Allow long ints as terminator values; also, treat a terminator of... X-Git-Tag: v2.5a0~1717 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca69f0248c94a08f2077f8e17cf6ad556a2d9d16;p=thirdparty%2FPython%2Fcpython.git [Patch #1002763] Allow long ints as terminator values; also, treat a terminator of 0 like the empty string or None --- diff --git a/Lib/asynchat.py b/Lib/asynchat.py index 28b89a2bde40..6f99ba1063c8 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: