make wline a bytestring if py2 and windows

This commit is contained in:
twangboy 2018-01-08 13:32:48 -07:00
parent 29788617f1
commit 6b1b77f9ef
No known key found for this signature in database
GPG Key ID: 93FF3BDEB278C9EB

View File

@ -1525,7 +1525,7 @@ def comment_line(path,
# Write the existing line (no change)
wline = line
wline = salt.utils.stringutils.to_bytes(wline) \
if salt.utils.platform.is_windows() \
if six.PY2 and salt.utils.platform.is_windows() \
else salt.utils.stringutils.to_str(wline)
w_file.write(wline)
except (OSError, IOError) as exc: