diff mbox series

[v2,10/14] git-p4: use functools.reduce instead of reduce

Message ID 20191213235247.23660-12-yang.zhao@skyboxlabs.com (mailing list archive)
State New, archived
Headers show
Series [v2,01/14] git-p4: make python2.7 the oldest supported version | expand

Commit Message

Yang Zhao Dec. 13, 2019, 11:52 p.m. UTC
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>
---
 git-p4.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/git-p4.py b/git-p4.py
index 68f9f4fdc6..7deee1b939 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -13,6 +13,7 @@ 
     sys.exit(1)
 import os
 import optparse
+import functools
 import marshal
 import subprocess
 import tempfile
@@ -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