Fix bare except statements for expected ImportErrors

This commit is contained in:
Daniel Hahler
2018-06-13 13:35:09 +02:00
committed by Scott Kitterman
parent 229ac42db9
commit 0338aedcc6
+8 -8
View File
@@ -40,15 +40,15 @@ import time
# only needed for arc # only needed for arc
try: try:
from authres import AuthenticationResultsHeader from authres import AuthenticationResultsHeader
except: except ImportError:
pass pass
# only needed for ed25519 signing/verification # only needed for ed25519 signing/verification
try: try:
import nacl.signing import nacl.signing
import nacl.encoding import nacl.encoding
except: except ImportError:
pass pass
from dkim.canonicalization import ( from dkim.canonicalization import (
@@ -67,10 +67,10 @@ from dkim.crypto import (
UnparsableKeyError, UnparsableKeyError,
) )
try: try:
from dkim.dnsplug import get_txt from dkim.dnsplug import get_txt
except: except ImportError:
def get_txt(s): def get_txt(s):
raise RuntimeError("DKIM.verify requires DNS or dnspython module") raise RuntimeError("DKIM.verify requires DNS or dnspython module")
from dkim.util import ( from dkim.util import (
get_default_logger, get_default_logger,
InvalidTagValueList, InvalidTagValueList,