diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-04-08 07:23:44 +0000 |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-04-08 07:23:44 +0000 |
commit | d9d43dc5aef5eb46dc9de78c4b5f80a975115a65 (patch) | |
tree | 8e971f01539157627aadbe85ffbd39c56546c167 /Lib/asynchat.py | |
parent | fe4c78c76e260b71fa74b51208665dc3664aedfa (diff) | |
download | cpython-d9d43dc5aef5eb46dc9de78c4b5f80a975115a65.tar.gz |
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.
>>> "abc"*0 is "abc"*0
0
>>>
but they're rare, and I don't see any such operations in asynchat.
Diffstat (limited to 'Lib/asynchat.py')
-rw-r--r-- | Lib/asynchat.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/asynchat.py b/Lib/asynchat.py index 584aab9f3e..1f9fc6839b 100644 --- a/Lib/asynchat.py +++ b/Lib/asynchat.py @@ -165,7 +165,7 @@ class async_chat (asyncore.dispatcher): # return len(self.ac_out_buffer) or len(self.producer_fifo) or (not self.connected) # this is about twice as fast, though not as clear. return not ( - (self.ac_out_buffer is '') and + (self.ac_out_buffer == '') and self.producer_fifo.is_empty() and self.connected ) |