Skip to content

Commit

Permalink
Fix a few ruff --preview warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
arichardson committed Feb 9, 2024
1 parent 2656104 commit adcb7da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pycheribuild/config/chericonfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import collections
import getpass
import grp
import inspect
import os
import re
import shutil
Expand Down Expand Up @@ -577,7 +578,7 @@ def _ensure_required_properties_set(self) -> bool:
if key in self.__optional_properties:
continue
# don't do the descriptor stuff:
value = object.__getattribute__(self, key)
value = inspect.getattr_static(self, key)
if value is None:
raise RuntimeError("Required property " + key + " is not set!")
assert self.cheri_sdk_dir.is_absolute(), self.cheri_sdk_dir
Expand Down
2 changes: 1 addition & 1 deletion pycheribuild/config/config_loader_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def _convert_type(self, loaded_result: _LoadedConfigValue) -> "Optional[T]":
result = loaded_result.value
# self.debug_msg("Converting", result, "to", self.value_type)
# if the requested type is list, tuple, etc. use shlex.split() to convert strings to lists
if self.value_type != str and isinstance(result, str):
if self.value_type is not str and isinstance(result, str):
if isinstance(self.value_type, type) and issubclass(self.value_type, collections.abc.Sequence):
string_value = result
result = shlex.split(string_value)
Expand Down
2 changes: 1 addition & 1 deletion pycheribuild/projects/run_fvp.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ def add_hostbridge_params(*params):
tcp_ports += [gdb_port]
# XXX this matches on any host address; that may not be quite right
for x in self.extra_tcp_forwarding:
if x == "":
if not x:
self.fatal("Bad extra-tcp-forwarding (empty forward?)")
continue
hg = x.split("=")
Expand Down

0 comments on commit adcb7da

Please sign in to comment.