Skip to content

Commit

Permalink
Better formatting of string #976
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Peng committed May 30, 2018
1 parent 86e8961 commit 158ec46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sos/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ def format_par(name, par):
elif isinstance(val, Sequence) and not isinstance(val, str):
return f'--{name} {" ".join(str(x) for x in val)} (as {val.__class__.__name__})'
elif isinstance(val, str):
return f'--{name} {val!r}'
return f'--{name} {val if val.isalnum() else repr(val)}'
else:
return f'--{name} {val} (as {val.__class__.__name__})'
except:
Expand Down

0 comments on commit 158ec46

Please sign in to comment.