mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-37363: Add audit events for a range of modules (GH-14301)
This commit is contained in:
parent
9bbf4d7083
commit
60419a7e96
37 changed files with 165 additions and 18 deletions
|
@ -335,6 +335,7 @@ class SMTP:
|
|||
port = self.default_port
|
||||
if self.debuglevel > 0:
|
||||
self._print_debug('connect:', (host, port))
|
||||
sys.audit("smtplib.SMTP.connect", self, host, port)
|
||||
self.sock = self._get_socket(host, port, self.timeout)
|
||||
self.file = None
|
||||
(code, msg) = self.getreply()
|
||||
|
@ -352,6 +353,7 @@ class SMTP:
|
|||
# should not be used, but 'data' needs to convert the string to
|
||||
# binary itself anyway, so that's not a problem.
|
||||
s = s.encode(self.command_encoding)
|
||||
sys.audit("smtplib.SMTP.send", self, s)
|
||||
try:
|
||||
self.sock.sendall(s)
|
||||
except OSError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue