Skip to content

Commit

Permalink
git-p4: use functools.reduce instead of reduce
Browse files Browse the repository at this point in the history
For python3, reduce() has been moved to functools.reduce().  This is
also available in python2.7.

Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
yangskyboxlabs authored and gitster committed Jan 15, 2020
1 parent 4294d74 commit a6b1306
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-p4.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
sys.exit(1)
import os
import optparse
import functools
import marshal
import subprocess
import tempfile
Expand Down Expand Up @@ -1158,7 +1159,7 @@ def pushFile(self, localLargeFile):
assert False, "Method 'pushFile' required in " + self.__class__.__name__

def hasLargeFileExtension(self, relPath):
return reduce(
return functools.reduce(
lambda a, b: a or b,
[relPath.endswith('.' + e) for e in gitConfigList('git-p4.largeFileExtensions')],
False
Expand Down

0 comments on commit a6b1306

Please sign in to comment.