Skip to content

Commit

Permalink
Avoid python warning about unknown warning category (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Sep 22, 2022
1 parent f6b3871 commit aac5ae2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ansible_compat/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ def __init__(
# Reduce noise from paramiko, unless user already defined PYTHONWARNINGS
# paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated
# https://github.com/paramiko/paramiko/issues/2038
# As CryptographyDeprecationWarning is not a builtin, we cannot use
# PYTHONWARNINGS to ignore it using category but we can use message.
# https://stackoverflow.com/q/68251969/99834
if "PYTHONWARNINGS" not in self.environ:
self.environ["PYTHONWARNINGS"] = "ignore::CryptographyDeprecationWarning"
self.environ["PYTHONWARNINGS"] = "ignore:Blowfish has been deprecated"

if isolated:
self.cache_dir = get_cache_dir(self.project_dir)
Expand Down

0 comments on commit aac5ae2

Please sign in to comment.