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

handle empty migration list case for wide listing #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

reedstrm
Copy link
Contributor

Hit this traceback recently:

Traceback (most recent call last):
  File "/home/reedstrm/src/rewrite/bin/dbmigrator", line 11, in <module>
    load_entry_point('db-migrator', 'console_scripts', 'dbmigrator')()
  File "/home/reedstrm/src/rewrite/db-migrator/dbmigrator/cli.py", line 116, in main
    return args['cmmd'](**args)
  File "/home/reedstrm/src/rewrite/db-migrator/dbmigrator/utils.py", line 155, in wrapper
    return func(cursor, *args, **kwargs)
  File "/home/reedstrm/src/rewrite/db-migrator/dbmigrator/commands/list.py", line 29, in cli_command
    name_width = max([len(name) for _, name, _ in migrations])
ValueError: max() arg is an empty sequence

This code solves it.

@coveralls
Copy link

coveralls commented Feb 22, 2018

Coverage Status

Coverage decreased (-0.4%) to 97.366% when pulling e981281 on Connexions:wide-empty-list into 7a8e0e2 on karenc:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants