]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-p4: use functools.reduce instead of reduce
authorYang Zhao <yang.zhao@skyboxlabs.com>
Fri, 13 Dec 2019 23:52:44 +0000 (15:52 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Jan 2020 20:53:40 +0000 (12:53 -0800)
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>
git-p4.py

index 68f9f4fdc6b8e0f2823264a66c57ffbc778cb8a8..7deee1b93918d8f57ddd0a17fa648306d17dd206 100755 (executable)
--- a/git-p4.py
+++ b/git-p4.py
@@ -13,6 +13,7 @@ if sys.version_info.major < 3 and sys.version_info.minor < 7:
     sys.exit(1)
 import os
 import optparse
+import functools
 import marshal
 import subprocess
 import tempfile
@@ -1158,7 +1159,7 @@ class LargeFileSystem(object):
         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