Skip to content

Commit

Permalink
#4378 don't quote strings if we don't have to
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Oct 12, 2024
1 parent b7782c2 commit ba3d760
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions xpra/client/base/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ def prettify(k, v):
if len(eltypes) == 1 and tuple(eltypes)[0] in (int, bool, float):
return str(v)
return type(v)(prettify(k, x) for x in v)
return v
elif isinstance(v, str) and v.isprintable():
return v
return repr(v)

def print_dict(d: dict, path=""):
for k in sorted_nicely(d.keys()):
Expand All @@ -238,8 +240,8 @@ def print_dict(d: dict, path=""):
if isinstance(v, dict):
print_dict(v, kpath)
continue
fv = str(prettify(k, v))
print_fn(f"{kpath}={repr(fv)}")
fv = prettify(k, v)
print_fn(f"{kpath}={fv}")

exit_code = ExitCode.OK
try:
Expand Down

0 comments on commit ba3d760

Please sign in to comment.