mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
bpo-37363: Add audit events for a range of modules (GH-14301)
(cherry picked from commit 60419a7e96
)
Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
parent
366dac99c0
commit
8763d43a95
37 changed files with 165 additions and 18 deletions
|
@ -289,6 +289,7 @@ class IMAP4:
|
|||
# (which is used by socket.create_connection()) expects None
|
||||
# as a default value for host.
|
||||
host = None if not self.host else self.host
|
||||
sys.audit("imaplib.IMAP4.open", self, self.host, self.port)
|
||||
return socket.create_connection((host, self.port))
|
||||
|
||||
def open(self, host = '', port = IMAP4_PORT):
|
||||
|
@ -318,6 +319,7 @@ class IMAP4:
|
|||
|
||||
def send(self, data):
|
||||
"""Send data to remote."""
|
||||
sys.audit("imaplib.IMAP4.send", self, data)
|
||||
self.sock.sendall(data)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue