Skip to content

Commit

Permalink
Simplify if statements (via ruff PLR1714).
Browse files Browse the repository at this point in the history
  • Loading branch information
fschulze authored and markmcclain committed Jan 8, 2024
1 parent 26d74d3 commit c7f14c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/testing/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def downloadrelease(self, code, url):

def change_password(self, user, password):
auth = getattr(self, "auth", None)
if auth is None or auth[0] != user and auth[0] != "root":
if auth is None or auth[0] not in (user, "root"):
raise ValueError("need to be logged as %r or root" % user)
self.devpi("user", "-m", user, "password=%s" % password)
if user == "root" and password != "":
Expand Down
2 changes: 1 addition & 1 deletion server/test_devpi_server/simpypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def start_response(status, headers):
start_response(200, headers)
self.wfile.write(b'\n'.join(releases))
return
elif p == ['', 'simple', ''] or p == ['', 'simple']:
elif p in (['', 'simple', ''], ['', 'simple']):
# root listing
projects = [
'<a href="/simple/%s/">%s</a>' % (k, v['title'])
Expand Down
2 changes: 1 addition & 1 deletion web/devpi_web/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def doc_show(context, request):
project=name, version='latest', relpath="index.html")))
try:
stable_doc_info = get_doc_info(context, request, version='stable', check_content=False)
if stable_doc_info['doc_version'] != doc_info['doc_version'] and stable_doc_info['doc_version'] != latest_doc_info['doc_version']:
if stable_doc_info['doc_version'] not in (doc_info['doc_version'], latest_doc_info['doc_version']):
version_links.append(dict(
title="Stable documentation",
url=request.route_url(
Expand Down

0 comments on commit c7f14c4

Please sign in to comment.