Skip to content

Commit 097cf85

Browse files
author
Moshe Zadka
committed
Inspired by Tim Peters' 1.14->1.15 checkin to asynchat
Quoting orignal message: ''' Fix from the Madusa mailing list: http://groups.yahoo.com/group/medusa/message/333 It's clear that Medusa should not be checking for an empty buffer via "buf is ''". The patch merely changes "is" to "==". However, there's a mystery here all the same: Python attempts to store null strings uniquely, so it's unclear why "buf is ''" ever returned false when buf actually was empty. *Some* string operations produce non-unique null strings, e.g. '''
1 parent abbae5b commit 097cf85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/asynchat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def writable (self):
166166
# return len(self.ac_out_buffer) or len(self.producer_fifo) or (not self.connected)
167167
# this is about twice as fast, though not as clear.
168168
return not (
169-
(self.ac_out_buffer is '') and
169+
(self.ac_out_buffer == '') and
170170
self.producer_fifo.is_empty() and
171171
self.connected
172172
)

0 commit comments

Comments
 (0)