Use the catch_warnings context manager when importing relatorio

Using warnings.resetwarnings also reset the warnings filter set from the
environment variable which makes working on fixing warnings more difficult.
This commit is contained in:
Nicolas Évrard committed 2024-05-16 21:19:17 +02:00
1 parent 1035df5340
commit 5d2e5f9329
1 file changed
+3 -3
+3 -3
View File
@@ -48,10 +48,10 @@ try:
except ImportError:
qrcode = None
warnings.simplefilter("ignore")
import relatorio.reporting # noqa: E402
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import relatorio.reporting # noqa: E402
warnings.resetwarnings()
try:
from relatorio.templates.opendocument import MANIFEST, Manifest
except ImportError: