Raise errors in Project if the configured backend could not be loaded.
authorW. Trevor King <wking@drexel.edu>
Thu, 16 Feb 2012 12:50:22 +0000 (07:50 -0500)
committerW. Trevor King <wking@drexel.edu>
Thu, 16 Feb 2012 12:50:22 +0000 (07:50 -0500)
update_copyright/project.py

index e9de6cc17fe958a656b307cf11c569d7787150bc..18280b14b3508f251d8ebba48cb7861fa704ccf5 100644 (file)
@@ -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))