Skip to content

Commit

Permalink
replace list and dict calls
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch committed Apr 7, 2024
1 parent e882733 commit 70a7175
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions colcon_meson/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ def __init__(self):
def add_arguments(self, *, parser):
parser.add_argument('--meson-args',
nargs='*', metavar='*',
type=str.lstrip, default=list(),
type=str.lstrip, default=[],
help="Pass 'setup' arguments to Meson projects.",
)

def get_default_args(self, args):
margs = list()
margs = []

# meson installs by default to architecture specific subdirectories,
# e.g. "lib/x86_64-linux-gnu", but the LibraryPathEnvironment hook
Expand Down Expand Up @@ -161,7 +161,7 @@ async def _reconfigure(self, args, env):
if not run_init_setup and not config_changed:
return

cmd = list()
cmd = []
cmd += [self.meson_path]
cmd += ["setup"]
cmd.extend(marg_def)
Expand All @@ -179,7 +179,7 @@ async def _reconfigure(self, args, env):
async def _build(self, args, env, *, additional_targets=None):
self.progress('build')

cmd = list()
cmd = []
cmd += [self.meson_path]
cmd += ["compile"]

Expand Down Expand Up @@ -227,7 +227,7 @@ async def _install(self, args, env):
with open(lastinstalltargetfile, 'w') as f:
json.dump(install_targets, f)

cmd = list()
cmd = []
cmd += [self.meson_path]
cmd += ["install"]

Expand Down
4 changes: 2 additions & 2 deletions colcon_meson/identification.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, source_root: str, subdir: str, subproject: str):

self.environment = environment

self.data = dict()
self.data = {}
self.data["dependencies"] = set()

def evaluate_statement(self, cur: mparser.BaseNode) -> typing.Optional[InterpreterObject]:
Expand Down Expand Up @@ -89,7 +89,7 @@ def parse(self) -> dict:
try:
self.load_root_meson_file()
except mesonlib.MesonException:
return dict()
return {}

self.evaluate_codeblock(self.ast)
return self.data
Expand Down

0 comments on commit 70a7175

Please sign in to comment.