From a88b3be0934ec84349e5b91d3607e4c731fd0170 Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Fri, 18 Jul 2014 17:23:19 +0100 Subject: [PATCH] Unittest - Memoize utils.which for faketime speedups --- test/basetest/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/basetest/utils.py b/test/basetest/utils.py index b47230226..6483feee7 100644 --- a/test/basetest/utils.py +++ b/test/basetest/utils.py @@ -181,8 +181,10 @@ def memoize(obj): try: from shutil import which + which = memoize(which) except ImportError: # NOTE: This is shutil.which backported from python-3.3.3 + @memoize def which(cmd, mode=os.F_OK | os.X_OK, path=None): """Given a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such