Skip to content

Commit 3efacd7

Browse files
committed
This should fix flake8 on py3
See #177
1 parent d437078 commit 3efacd7

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

Diff for: git/cmd.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
from git.compat import (
2323
string_types,
2424
defenc,
25-
PY3
25+
PY3,
26+
# just to satisfy flake8 on py3
27+
unicode
2628
)
2729

2830
execute_kwargs = ('istream', 'with_keep_cwd', 'with_extended_output',

Diff for: git/compat.py

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def bchr(n):
3333
return bytes([n])
3434
def mviter(d):
3535
return d.values()
36+
unicode = str
3637
else:
3738
FileType = file
3839
# usually, this is just ascii, which might not enough for our encoding needs
@@ -41,6 +42,7 @@ def mviter(d):
4142
defenc = 'utf-8'
4243
byte_ord = ord
4344
bchr = chr
45+
unicode = unicode
4446
def mviter(d):
4547
return d.itervalues()
4648

Diff for: git/test/performance/test_streams.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,6 @@ def test_large_data_streaming(self, rwrepo):
140140
print(msg, file=sys.stderr)
141141

142142
# compare
143-
print ("Git-Python is %f %% faster than git when reading big %s files in chunks"
143+
print("Git-Python is %f %% faster than git when reading big %s files in chunks"
144144
% (100.0 - (elapsed_readchunks / gelapsed_readchunks) * 100, desc), file=sys.stderr)
145145
# END for each randomization factor

Diff for: git/test/test_repo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ def test_rev_parse(self):
526526
assert obj.type == ref.object.type
527527
num_resolved += 1
528528
except BadObject:
529-
print ("failed on %s" % path_section)
529+
print("failed on %s" % path_section)
530530
# is fine, in case we have something like 112, which belongs to remotes/rname/merge-requests/112
531531
pass
532532
# END exception handling

0 commit comments

Comments
 (0)