Support coloring pathlib.Path objects

This commit is contained in:
2Shirt 2019-12-13 16:38:24 -07:00
parent da5f521f92
commit 6bfee95043
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -738,9 +738,9 @@ def color_string(strings, colors, sep=' '):
msg = []
# Convert to tuples if necessary
if isinstance(strings, str):
if isinstance(strings, (str, pathlib.Path)):
strings = (strings,)
if isinstance(colors, str):
if isinstance(colors, (str, pathlib.Path)):
colors = (colors,)
# Build new string with color escapes added