Skip to content

Commit

Permalink
Trying out a conditional for py3
Browse files Browse the repository at this point in the history
  • Loading branch information
goosemo committed Jun 25, 2017
1 parent 04d16d6 commit 5e90a1a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gitchangelog/gitchangelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,10 @@ def FileInsertAtFirstRegexMatch(filename, pattern, flags=0,

def write_content(f, content):
for content_line in content:
f.write(content_line.encode(_preferred_encoding))
if PY3:
f.write(content_line)
else:
f.write(content_line.encode(_preferred_encoding))

def _wrapped(content):
index = idx(_file_regex_match(filename, pattern, flags=flags))
Expand Down

0 comments on commit 5e90a1a

Please sign in to comment.