Skip to content
Snippets Groups Projects
Commit 82ca9782 authored by Filippo Cremonese's avatar Filippo Cremonese
Browse files

Use lru_cache instead of cached_property for compatibility with older python versions

parent 120e88bb
No related branches found
No related tags found
No related merge requests found
import os.path import os.path
import re import re
from functools import cached_property from functools import lru_cache
from .action import Action from .action import Action
from .util import run_script from .util import run_script
...@@ -31,7 +31,8 @@ class CloneAction(Action): ...@@ -31,7 +31,8 @@ class CloneAction(Action):
def _is_satisfied(self): def _is_satisfied(self):
return os.path.exists(self.environment["SOURCE_DIR"]) return os.path.exists(self.environment["SOURCE_DIR"])
@cached_property @property
@lru_cache()
def remotes(self): def remotes(self):
result = run_script('git -C "$ORCHESTRA_DOTDIR" remote show', environment=self.environment, quiet=True) result = run_script('git -C "$ORCHESTRA_DOTDIR" remote show', environment=self.environment, quiet=True)
return result.stdout.decode("utf-8").split("\n").strip().split("\n") return result.stdout.decode("utf-8").split("\n").strip().split("\n")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment