mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unittest - Memoize utils.which for faketime speedups
This commit is contained in:
parent
d69533add1
commit
a88b3be093
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue