Merge lp:~jelmer/brz/launchpadlib-error into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/launchpadlib-error
Merge into: lp:brz
Diff against target: 25 lines (+11/-1)
1 file modified
breezy/plugins/launchpad/lp_api.py (+11/-1)
To merge this branch: bzr merge lp:~jelmer/brz/launchpadlib-error
Reviewer Review Type Date Requested Status
Martin Packman Approve
Saša Janiška Pending
Review via email: mp+363218@code.launchpad.net

Commit message

Add clearer error when launchpadlib is missing.

Description of the change

Add clearer error when launchpadlib is missing.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'breezy/plugins/launchpad/lp_api.py'
--- breezy/plugins/launchpad/lp_api.py 2019-01-28 21:00:58 +0000
+++ breezy/plugins/launchpad/lp_api.py 2019-02-14 19:09:45 +0000
@@ -45,10 +45,20 @@
45 )45 )
46from ...i18n import gettext46from ...i18n import gettext
4747
48
49class LaunchpadlibMissing(errors.DependencyNotPresent):
50
51 _fmt = ("launchpadlib is required for Launchpad API access. "
52 "Please install the launchpadlib package.")
53
54 def __init__(self, e):
55 super(LaunchpadlibMissing, self).__init__(
56 'launchpadlib', e)
57
48try:58try:
49 import launchpadlib59 import launchpadlib
50except ImportError as e:60except ImportError as e:
51 raise errors.DependencyNotPresent('launchpadlib', e)61 raise LaunchpadlibMissing(e)
5262
53from launchpadlib.launchpad import (63from launchpadlib.launchpad import (
54 Launchpad,64 Launchpad,

Subscribers

People subscribed via source and target branches