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

Fix some ruff errors and simplify LICHESS_TYPE #1082

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

Conversation

AttackingOrDefending
Copy link
Member

Type of pull request:

  • Bug fix
  • Feature
  • Other

Description:

Fixes some ruff errors and removes them from being ignored. I'm not sure if some changes (like removing else after return) are beneficial, so I'm open to reverting them back.

Also, makes Lichess in test_bot.lichess inherit from lib.lichess.Lichess to simplify away the LICHESS_TYPE variable.

Related Issues:

None.

Checklist:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

Screenshots/logs (if applicable):

from requests.exceptions import ConnectionError, HTTPError, ReadTimeout
from requests.exceptions import ConnectionError as RequestsConnectionError, HTTPError, ReadTimeout
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this renamed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because of the error "A004" # Import is shadowing a Python builtin. Python has a ConnectionError itself which can be used without being imported, so by importing the new error from requests we overrode it.

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.

2 participants