Skip to content
Permalink
Browse files

Merge pull request #150 from yarikoptic/rf-isinstance

RF: use isinstance instead of type().__name__ comparison
  • Loading branch information...
yarikoptic committed Mar 12, 2019
2 parents b053eeb + b61da12 commit 1c736a1e8b495a6aad89696e3646191fc0b50f26
Showing with 2 additions and 2 deletions.
  1. +2 −2 duecredit/stub.py
@@ -24,7 +24,7 @@
License: BSD-2
"""

__version__ = '0.0.7'
__version__ = '0.0.8'


class InactiveDueCreditCollector(object):
@@ -57,7 +57,7 @@ def _donothing_func(*args, **kwargs):
raise RuntimeError(
"Imported due lacks .cite. DueCredit is now disabled")
except Exception as e:
if type(e).__name__ not in ('ImportError', 'ModuleNotFoundError'):
if not isinstance(e, ImportError):
import logging
logging.getLogger("duecredit").error(
"Failed to import duecredit due to %s" % str(e))

0 comments on commit 1c736a1

Please sign in to comment.
You can’t perform that action at this time.