Skip to content

Commit

Permalink
add fix for Lock not being a class until python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
helylle committed Sep 17, 2024
1 parent eeaea69 commit a31fee9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/eduid/webapp/idp/sso_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ class ExpiringCacheMem:
:param lock: threading.Lock compatible locking instance
"""

def __init__(self, name: str, logger: logging.Logger | None, ttl: int, lock: Lock | None = None):
# TODO: fix when python 3.13 is our target environment
# use quote annotations on lock for now until python 3.13 is released
# threading.Lock is not a class but a factory function, see:
# https://github.com/python/cpython/pull/114479
def __init__(self, name: str, logger: logging.Logger | None, ttl: int, lock: "Lock | None" = None):
self.logger = logger
self.ttl = ttl
self.name = name
Expand Down

0 comments on commit a31fee9

Please sign in to comment.