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

Resolve pylint error: remove outdated exception subscript #839

Merged
merged 1 commit into from
Mar 26, 2019

Conversation

awwad
Copy link
Contributor

@awwad awwad commented Mar 26, 2019

Python3 does not support exception subscripting:
e.g.

except ... as e:
  e[1]       # does not work in Python3

This five-year-old line of code was presumably not covered by testing, allowing it to persist.

I resolved with a minor change: using an error more appropriate to this particular problem, one that already includes a signable field.

In looking at this, I'm not pleased by how differently developer_tool.py and repository_tool.py code their status() functions.... That merits some attention, but it won't be here.

Python3 does not support exception subscripting:
  e.g. except ... as e:
         e[1]       # does not work in Python3

This line of code was presumably not covered by testing,
allowing it to persist.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
@JustinCappos
Copy link
Member

Lukas, would you kindly review? It looks good to me.

@awwad
Copy link
Contributor Author

awwad commented Mar 26, 2019

I'll merge this since it's valuable to get the build passing again and it's fairly straightforward, but I could still use Lukas's opinion at some point, since we've discussed this.

@awwad awwad merged commit 58be640 into develop Mar 26, 2019
Copy link
Member

@lukpueh lukpueh left a comment

Choose a reason for hiding this comment

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

This is the solution we discussed yesterday, and it makes sense, although the name of the Exception class is debatable (as we also discussed yesterday), the except clause should be covered by tests (as we also ...) and tuf's coveralls.io setup needs some fixing (as ...). :)

@awwad awwad deleted the pylint_fix_exception_subscripting branch April 1, 2019 20:01
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.

4 participants