File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change 6
6
import os
7
7
import shutil
8
8
import sys
9
- from functools import wraps
9
+ import functools
10
10
from pathlib import Path
11
11
12
12
from . import diagnostics
@@ -112,19 +112,8 @@ def delete_contents(dirname, exclude=None):
112
112
delete_file (entry )
113
113
114
114
115
- # TODO(sbc): Replace with functools.cache, once we update to python 3.7
116
- def memoize (func ):
117
- results = {}
118
-
119
- @wraps (func )
120
- def helper (* args , ** kwargs ):
121
- assert not kwargs
122
- key = (func .__name__ , args )
123
- if key not in results :
124
- results [key ] = func (* args )
125
- return results [key ]
126
-
127
- return helper
115
+ # TODO(sbc): Replace with functools.cache, once we update to python 3.9
116
+ memoize = functools .lru_cache (maxsize = None )
128
117
129
118
130
119
# TODO: Move this back to shared.py once importing that file becoming side effect free (i.e. it no longer requires a config).
You can’t perform that action at this time.
0 commit comments