From f00624e069f56f452ba588429bb7e42070e7ee70 Mon Sep 17 00:00:00 2001 From: J08nY Date: Mon, 7 Aug 2017 17:27:18 +0200 Subject: Mute PGPy warnings. --- src/mailman_pgp/plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mailman_pgp/plugin.py') diff --git a/src/mailman_pgp/plugin.py b/src/mailman_pgp/plugin.py index 7ee31e2..639de93 100644 --- a/src/mailman_pgp/plugin.py +++ b/src/mailman_pgp/plugin.py @@ -16,6 +16,7 @@ # this program. If not, see . """A PGP plugin for GNU Mailman.""" +import warnings from mailman.interfaces.plugin import IPlugin from public import public @@ -34,11 +35,16 @@ class PGPMailman: def pre_hook(self): """See `IPlugin`.""" + # Load the config. config.load(self.name) config.validate() config.convert() + # Load module global stuff and attach it to the config. config.db = Database() config.pgp = PGP() + # Mute PGPy, it gives UserWarnings even during normal use. + warnings.filterwarnings(action='ignore', category=UserWarning, + module='.*pgpy.*') def post_hook(self): """See `IPlugin`.""" -- cgit v1.2.3-70-g09d2