mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-11-16 00:28:25 +01:00
Fixed a UnicodeWarning that could occur under Python 2.
This commit is contained in:
parent
db77273659
commit
8d597238c1
1 changed files with 9 additions and 9 deletions
18
changes.py
18
changes.py
|
@ -98,23 +98,23 @@ class Changes:
|
|||
lines = git_log_r.readlines()
|
||||
|
||||
for i in lines:
|
||||
i = codecs.getdecoder("unicode_escape")(i.strip())[0]
|
||||
i = i.encode("latin-1", "replace")
|
||||
i = i.decode("utf-8", "replace")
|
||||
j = codecs.getdecoder("unicode_escape")(i.strip())[0]
|
||||
j = j.encode("latin-1", "replace")
|
||||
j = j.decode("utf-8", "replace")
|
||||
|
||||
if Commit.is_commit_line(i) or i == lines[-1]:
|
||||
if Commit.is_commit_line(j) or i is lines[-1]:
|
||||
if found_valid_extension:
|
||||
self.commits.append(commit)
|
||||
|
||||
found_valid_extension = False
|
||||
commit = Commit(i)
|
||||
commit = Commit(j)
|
||||
|
||||
if FileDiff.is_filediff_line(i) and not filtering.set_filtered(FileDiff.get_filename(i)):
|
||||
extensions.add_located(FileDiff.get_extension(i))
|
||||
if FileDiff.is_filediff_line(j) and not filtering.set_filtered(FileDiff.get_filename(j)):
|
||||
extensions.add_located(FileDiff.get_extension(j))
|
||||
|
||||
if FileDiff.is_valid_extension(i):
|
||||
if FileDiff.is_valid_extension(j):
|
||||
found_valid_extension = True
|
||||
filediff = FileDiff(i)
|
||||
filediff = FileDiff(j)
|
||||
commit.add_filediff(filediff)
|
||||
|
||||
if interval.has_interval() and len(self.commits) > 0:
|
||||
|
|
Loading…
Reference in a new issue