[git_common] Use kwarg syntax for memoize_one

Change-Id: I764670c1a0d90e94e437472d6bc7a8ce1d0a11cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5762198
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
changes/98/5762198/4
Allen Li 10 months ago committed by LUCI CQ
parent a3fb9bad66
commit 4c050c6f1a

@ -154,7 +154,7 @@ class BadCommitRefException(Exception):
super(BadCommitRefException, self).__init__(msg)
def memoize_one(**kwargs):
def memoize_one(*, threadsafe: bool):
"""Memoizes a single-argument pure function.
Values of None are not cached.
@ -172,9 +172,6 @@ def memoize_one(**kwargs):
unittests.
* update(other) - Updates the contents of the cache from another dict.
"""
assert 'threadsafe' in kwargs, 'Must specify threadsafe={True,False}'
threadsafe = kwargs['threadsafe']
if threadsafe:
def withlock(lock, f):

Loading…
Cancel
Save