|
28 | 28 | from copy import copy |
29 | 29 | from datetime import datetime, timezone, timedelta |
30 | 30 | from enum import Enum |
31 | | -from typing import Union, Any, Coroutine, Callable, Optional, Pattern, List |
| 31 | +from typing import Union, Any, Coroutine, Callable, Optional, List |
32 | 32 |
|
33 | 33 | # to avoid imap servers to kill the connection after 30mn idling |
34 | 34 | # cf https://www.imapwiki.org/ClientImplementation/Synchronization |
@@ -620,7 +620,7 @@ async def simple_command(self, name, *args: str) -> Response: |
620 | 620 | async def wait_async_pending_commands(self) -> None: |
621 | 621 | await asyncio.wait([asyncio.ensure_future(cmd.wait()) for cmd in self.pending_async_commands.values()]) |
622 | 622 |
|
623 | | - async def wait(self, state_regexp: Pattern) -> None: |
| 623 | + async def wait(self, state_regexp: str) -> None: |
624 | 624 | state_re = re.compile(state_regexp) |
625 | 625 | async with self.state_condition: |
626 | 626 | await self.state_condition.wait_for(lambda: state_re.match(self.state)) |
@@ -840,7 +840,7 @@ async def rename(self, old_mailbox_name: str, new_mailbox_name: str) -> Response |
840 | 840 | async def getquotaroot(self, mailbox_name: str) -> Response: |
841 | 841 | return await asyncio.wait_for(self.protocol.execute(Command('GETQUOTAROOT', self.protocol.new_tag(), 'INBOX', untagged_resp_name='QUOTA')), self.timeout) |
842 | 842 |
|
843 | | - async def list(self, reference_name: str, mailbox_pattern: Pattern) -> Response: |
| 843 | + async def list(self, reference_name: str, mailbox_pattern: str) -> Response: |
844 | 844 | return await asyncio.wait_for(self.protocol.simple_command('LIST', reference_name, mailbox_pattern), self.timeout) |
845 | 845 |
|
846 | 846 | async def append(self, message_bytes, mailbox: str = 'INBOX', flags: str = None, date: Any = None) -> Response: |
|
0 commit comments