Skip to content

Commit

Permalink
Don't unconditionally import CryptographyDeprecationWarning.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastic committed Apr 10, 2020
1 parent 9d5b829 commit 2c035b8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
16 changes: 11 additions & 5 deletions src/lib/command.py
@@ -1,18 +1,24 @@
import socket
import subprocess
import time
import warnings

from cryptography.utils import CryptographyDeprecationWarning
import paramiko

from .logger import logger


warnings.filterwarnings(
action='ignore',
category=CryptographyDeprecationWarning,
)
try:
import warnings

from cryptography.utils import CryptographyDeprecationWarning

warnings.filterwarnings(
action='ignore',
category=CryptographyDeprecationWarning,
)
except Exception:
pass


class command():
Expand Down
17 changes: 11 additions & 6 deletions src/lib/rsync.py
@@ -1,19 +1,24 @@
import socket
import subprocess
import time
import warnings

from cryptography.utils import CryptographyDeprecationWarning
import paramiko

from models.config import config
from lib.logger import logger


warnings.filterwarnings(
action='ignore',
category=CryptographyDeprecationWarning,
)
try:
import warnings

from cryptography.utils import CryptographyDeprecationWarning

warnings.filterwarnings(
action='ignore',
category=CryptographyDeprecationWarning,
)
except Exception:
pass


class rsync():
Expand Down

0 comments on commit 2c035b8

Please sign in to comment.