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:
1 parent
1035df5340
commit
5d2e5f9329
1 file changed
+3
-3
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user