Skip to content

Commit

Permalink
[fix] Python3.8 custom 'cache' decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
lpascal-ledger committed Feb 26, 2024
1 parent dc0d672 commit dcd7294
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.7.1] - 2-24-02-26

### Fixed

- Specific `cache` mechanism for Python3.8 (`functools.cache` does not exists yet)

## [0.7.0] - 2024-02-26

### Changed
Expand Down
6 changes: 5 additions & 1 deletion speculos/mcu/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import io
from abc import ABC, abstractmethod
from functools import cache
try:
from functools import cache
except ImportError:
from functools import lru_cache
cache = lru_cache(maxsize=None)
from PIL import Image
from socket import socket
from typing import Any, Dict, IO, List, Optional, Tuple, Union
Expand Down
6 changes: 5 additions & 1 deletion speculos/mcu/nbgl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import sys
from construct import Struct, Int8ul, Int16ul
from enum import IntEnum
from functools import cache
try:
from functools import cache
except ImportError:
from functools import lru_cache
cache = lru_cache(maxsize=None)
from typing import Tuple

from .display import FrameBuffer, GraphicLibrary
Expand Down

0 comments on commit dcd7294

Please sign in to comment.