Skip to content

Commit

Permalink
fix coding errors in unstable-coredata subcommand
Browse files Browse the repository at this point in the history
One percent-formatted string had a .format() method style placeholder
and thus never output anything other than

TypeError: not all arguments converted during string formatting

The other error may be due to changing format elsewhere, because it
attempted to treat an entire tuple as though it only contained one
element. Based on context, it's clear this is supposed to be the actual
dependency name, but the internal representation may have changed over
time.

These fixes allow the command to run to completion successfully; of
course it is still unstable and possibly not actually maintained, since
it's been broken for 2 years and no one actually noticed.
  • Loading branch information
eli-schwartz authored and jpakkane committed Aug 22, 2021
1 parent 5a7b8d8 commit 0287af4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mesonbuild/munstable_coredata.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def run(options):
dump_compilers(v[for_machine])
elif k == 'deps':
def print_dep(dep_key, dep):
print(' ' + dep_key[0] + ": ")
print(' ' + dep_key[0][1] + ": ")
print(' compile args: ' + repr(dep.get_compile_args()))
print(' link args: ' + repr(dep.get_link_args()))
if dep.get_sources():
Expand All @@ -105,7 +105,7 @@ def print_dep(dep_key, dep):
for for_machine in iter(MachineChoice):
items_list = list(sorted(v[for_machine].items()))
if items_list:
print('Cached dependencies for {} machine' % for_machine.get_lower_case_name())
print(f'Cached dependencies for {for_machine.get_lower_case_name()} machine')
for dep_key, deps in items_list:
for dep in deps:
print_dep(dep_key, dep)
Expand Down

0 comments on commit 0287af4

Please sign in to comment.