summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiers Lauder <piers@cs.su.oz.au>2005-08-31 10:46:29 (GMT)
committerPiers Lauder <piers@cs.su.oz.au>2005-08-31 10:46:29 (GMT)
commit14f39402af52f72f1b7f15117bc827e4e81fbe5f (patch)
tree5698fdc426f53519b88a6ad4bd64f8dd60d3459e
parenta47d1c08d0911f2f49d92b8c6035593a672af436 (diff)
downloadcpython-14f39402af52f72f1b7f15117bc827e4e81fbe5f.zip
cpython-14f39402af52f72f1b7f15117bc827e4e81fbe5f.tar.gz
cpython-14f39402af52f72f1b7f15117bc827e4e81fbe5f.tar.bz2
changed select() so readonly flag is treated as a boolean
-rw-r--r--Lib/imaplib.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index 3e829d5..85ecd53 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -155,7 +155,7 @@ class IMAP4:
self.tagged_commands = {} # Tagged commands awaiting response
self.untagged_responses = {} # {typ: [data, ...], ...}
self.continuation_response = '' # Last continuation response
- self.is_readonly = None # READ-ONLY desired state
+ self.is_readonly = False # READ-ONLY desired state
self.tagnum = 0
# Open socket to server.
@@ -622,12 +622,12 @@ class IMAP4:
return self._untagged_response(typ, dat, name)
- def select(self, mailbox='INBOX', readonly=None):
+ def select(self, mailbox='INBOX', readonly=False):
"""Select a mailbox.
Flush all untagged responses.
- (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=None)
+ (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)
'data' is count of messages in mailbox ('EXISTS' response).
@@ -636,7 +636,7 @@ class IMAP4:
"""
self.untagged_responses = {} # Flush old responses.
self.is_readonly = readonly
- if readonly is not None:
+ if readonly:
name = 'EXAMINE'
else:
name = 'SELECT'