summaryrefslogtreecommitdiff
path: root/Lib/nntplib.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2019-06-24 08:42:54 -0700
committerGitHub <noreply@github.com>2019-06-24 08:42:54 -0700
commit60419a7e96577cf783b3b45bf3984f9fb0d7ddff (patch)
tree2718cb915663c42902621491ba60accce6729d42 /Lib/nntplib.py
parent9bbf4d7083a819cbcee2a6cd3df2802d4c50f734 (diff)
downloadcpython-git-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.tar.gz
bpo-37363: Add audit events for a range of modules (GH-14301)
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 5961a28ab7..e7bbc853c0 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: