Skip to content

Commit

Permalink
resmon: Use friendlier ImportError warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
chfoo committed Apr 20, 2015
1 parent 8004152 commit 9eca942
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions wpull/resmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
import gettext
import logging

from wpull.backport.logging import BraceMessage as __


_logger = logging.getLogger(__name__)
_ = gettext.gettext


try:
import psutil
except ImportError:
_logger.warning('psutil is not available.', exc_info=1)
except ImportError as error:
_logger.warning(__(
_('psutil: {error_msg}. Resource monitoring will be unavailable.'),
error_msg=error
))
psutil = None


Expand Down

0 comments on commit 9eca942

Please sign in to comment.