Skip to content

Commit

Permalink
Change cache to lru_cache
Browse files Browse the repository at this point in the history
since python 3.8 doesn't have it
  • Loading branch information
naveen521kk committed Sep 11, 2024
1 parent acb586c commit 739ddae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions manimpango/register_font.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import annotations

from functools import cache
from functools import lru_cache

from ._register_font import (
RegisteredFont,
Expand Down Expand Up @@ -151,4 +151,6 @@ def list_fonts() -> list:
:class:`list` :
List of fonts sorted alphabetically.
"""
return cache(_list_fonts)(tuple(sorted(registered_fonts, key=lambda x: x.path)))
return lru_cache(maxsize=None)(_list_fonts)(
tuple(sorted(registered_fonts, key=lambda x: x.path))
)

0 comments on commit 739ddae

Please sign in to comment.