Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't crash when no argument is given #1207

Merged
merged 1 commit into from
Jan 6, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion beets/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,8 @@ def _raw_main(args, lib=None):
# Special case for the `config --edit` command: bypass _setup so
# that an invalid configuration does not prevent the editor from
# starting.
if subargs[0] == 'config' and ('-e' in subargs or '--edit' in subargs):
if subargs and subargs[0] == 'config' \
and ('-e' in subargs or '--edit' in subargs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the indentation off by one? Eh. I guess flake8 didn't complain so it's probably all good. Just seemed odd to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I guess it just follows the identation of "subargs". Right. I'm too tired to look at code right now. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I guess it's visually aligned with the start of the expression on the previous line. In any case, feel free to fiddle with it using your newfound commit powers. 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's right! How would you prefer it to be? That's what pep8 prefers

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good actually! It's just a bit funny because it's 3 spaces, which is almost 4 spaces. Let's leave it.

from beets.ui.commands import config_edit
return config_edit()

Expand Down