[Python-checkins] python/dist/src/Lib asynchat.py,1.25,1.26
akuchling@users.sourceforge.net
akuchling at users.sourceforge.net
Thu Jun 9 16:59:47 CEST 2005
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19209
Modified Files:
asynchat.py
Log Message:
[Patch #1002763] Allow long ints as terminator values; also, treat a terminator of 0 like the empty string or None
Index: asynchat.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/asynchat.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- asynchat.py 27 Sep 2004 17:49:00 -0000 1.25
+++ asynchat.py 9 Jun 2005 14:59:45 -0000 1.26
@@ -101,11 +101,11 @@
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:
More information about the Python-checkins
mailing list