@matheusbsbs / matheus-bagliano / commits / a6b1306735
Fork 0

git-p4: use functools.reduce instead of reduce

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>

Yang Zhao committed Dec 13, 2019 at 15:52 UTC a6b1306735f1a6450f22f562275c994d03324672
1 file changed +2 -1
git-p4.py
+2 -1
@@ -13,6 +13,7 @@ if sys.version_info.major < 3 and sys.version_info.minor < 7:
13 sys.exit(1)
14 import os
15 import optparse
16 +import functools
17 import marshal
18 import subprocess
19 import tempfile
@@ -1158,7 +1159,7 @@ class LargeFileSystem(object):
1159 assert False, "Method 'pushFile' required in " + self.__class__.__name__
1160
1161 def hasLargeFileExtension(self, relPath):
1161 - return reduce(
1162 + return functools.reduce(
1163 lambda a, b: a or b,
1164 [relPath.endswith('.' + e) for e in gitConfigList('git-p4.largeFileExtensions')],
1165 False