Skip to content

Commit

Permalink
Restore single-expression logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 29, 2024
1 parent 4a91425 commit 67d3f31
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions jaraco/compat/py38.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ def removeprefix(prefix: str) -> str:
)


if sys.version_info < (3, 9): # pragma: no cover
cache = functools.lru_cache(maxsize=None)
r_fix = _fixer
else:
cache = functools.cache

def r_fix(orig: str) -> str:
return orig
def passthrough(orig: str) -> str:
return orig


r_fix = _fixer if sys.version_info < (3, 9) else passthrough

cache = (
functools.cache # type: ignore[attr-defined, unused-ignore]
if sys.version_info >= (3, 9)
else functools.lru_cache(maxsize=None)
)

0 comments on commit 67d3f31

Please sign in to comment.