From d38bea6752afd804715167164296737d565a7d20 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 16 Feb 2012 07:50:22 -0500 Subject: [PATCH] Raise errors in Project if the configured backend could not be loaded. --- update_copyright/project.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/update_copyright/project.py b/update_copyright/project.py index e9de6cc..18280b1 100644 --- a/update_copyright/project.py +++ b/update_copyright/project.py @@ -103,8 +103,12 @@ class Project (object): if vcs == 'Git': self._vcs = _GitBackend() elif vcs == 'Bazaar': + if _BazaarBackend is None: + raise _bazaar_import_error self._vcs = _BazaarBackend() elif vcs == 'Mercurial': + if _MercurialBackend is None: + raise _mercurial_import_error self._vcs = _MercurialBackend() else: raise NotImplementedError('vcs: {}'.format(vcs)) -- 2.26.2