Skip to content

Commit

Permalink
fix: don't crash when there are no entry points
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Mar 14, 2021
1 parent 9cac58e commit 85f6bd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion beet/toolchain/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def load_entry_points(self):

self.entry_points_loaded = True

for ep in entry_points()["beet"]:
for ep in entry_points().get("beet", ()):
if ep.name == "commands":
ep.load()

Expand Down
4 changes: 3 additions & 1 deletion beet/toolchain/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ def __init__(self, project: Project):

if ProjectBuilder.autoload is None:
ProjectBuilder.autoload = [
ep.value for ep in entry_points()["beet"] if ep.name == "autoload"
ep.value
for ep in entry_points().get("beet", ())
if ep.name == "autoload"
]

def build(self) -> Context:
Expand Down

0 comments on commit 85f6bd7

Please sign in to comment.