Skip to content

Commit

Permalink
base: fix flake8 complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
no92 committed Nov 7, 2024
1 parent 05c4c7e commit 80a3d97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
description-file = README.md

[flake8]
ignore = E203,W503,C
ignore = E203,W503,C,E731
max-line-length = 99
select = E,F,W,N,I,E504
13 changes: 6 additions & 7 deletions xbstrap/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ def try_rmtree(path):

def stat_mtime(path):
try:
with open(path) as f:
stat = os.stat(path)
return stat.st_mtime
stat = os.stat(path)
return stat.st_mtime
except FileNotFoundError:
return None

Expand Down Expand Up @@ -2351,7 +2350,7 @@ def run_program(
)
else:
if verbosity:
_util.log_info(f"Sysroot is not bind mounted")
_util.log_info("Sysroot is not bind mounted")

with tempfile.NamedTemporaryFile("w+") as f:
json.dump(cbuild_json, f)
Expand Down Expand Up @@ -3564,12 +3563,12 @@ def _do_ordering(self):
item.reverse_edge_list.append(target_item)

# Sort all edge lists to make the order deterministic.
def sort_items(l):
l.sort(key=PlanItem.get_ordering_key)
def sort_items(items):
items.sort(key=PlanItem.get_ordering_key)
# Alternatively, shuffle the edge lists to randomize the order.
# Note that sorting them first ensures that the order is deterministic.
if self.ordering_prng:
self.ordering_prng.shuffle(l)
self.ordering_prng.shuffle(items)

root_list = list(self._items.values())
sort_items(root_list)
Expand Down

0 comments on commit 80a3d97

Please sign in to comment.