summaryrefslogtreecommitdiffstats
path: root/Lib/nntplib.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-06-24 16:09:47 (GMT)
committerGitHub <noreply@github.com>2019-06-24 16:09:47 (GMT)
commit8763d43a9558b345af6a3a298afa18e7d3b42fd0 (patch)
tree260bf9be22b743195365c927df1e7ad709371568 /Lib/nntplib.py
parent366dac99c0c0c416a37874140696f59178db4e43 (diff)
downloadcpython-8763d43a9558b345af6a3a298afa18e7d3b42fd0.zip
cpython-8763d43a9558b345af6a3a298afa18e7d3b42fd0.tar.gz
cpython-8763d43a9558b345af6a3a298afa18e7d3b42fd0.tar.bz2
bpo-37363: Add audit events for a range of modules (GH-14301)
(cherry picked from commit 60419a7e96577cf783b3b45bf3984f9fb0d7ddff) Co-authored-by: Steve Dower <steve.dower@python.org>
Diffstat (limited to 'Lib/nntplib.py')
-rw-r--r--Lib/nntplib.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/nntplib.py b/Lib/nntplib.py
index 5961a28..e7bbc85 100644
--- a/Lib/nntplib.py
+++ b/Lib/nntplib.py
@@ -68,6 +68,7 @@ import socket
import collections
import datetime
import warnings
+import sys
try:
import ssl
@@ -413,6 +414,7 @@ class _NNTPBase:
def _putline(self, line):
"""Internal: send one line to the server, appending CRLF.
The `line` must be a bytes-like object."""
+ sys.audit("nntplib.NNTP.putline", self, line)
line = line + _CRLF
if self.debugging > 1: print('*put*', repr(line))
self.file.write(line)
@@ -1040,6 +1042,7 @@ class NNTP(_NNTPBase):
"""
self.host = host
self.port = port
+ sys.audit("nntplib.NNTP", self, host, port)
self.sock = socket.create_connection((host, port), timeout)
file = None
try:
@@ -1071,6 +1074,7 @@ if _have_ssl:
"""This works identically to NNTP.__init__, except for the change
in default port and the `ssl_context` argument for SSL connections.
"""
+ sys.audit("nntplib.NNTP", self, host, port)
self.sock = socket.create_connection((host, port), timeout)
file = None
try: