From a2f57dfcbc3c494b7f8d0da19c716b9002cd5d58 Mon Sep 17 00:00:00 2001 From: zackees Date: Fri, 23 Jun 2023 14:12:30 -0400 Subject: [PATCH] backport to python 3.9 --- src/disklru/disklru.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/disklru/disklru.py b/src/disklru/disklru.py index d16fff5..f911cd6 100644 --- a/src/disklru/disklru.py +++ b/src/disklru/disklru.py @@ -6,7 +6,7 @@ import os import sqlite3 from datetime import datetime -from typing import Any +from typing import Any, Optional # pylint: disable=line-too-long @@ -36,7 +36,7 @@ def __init__(self, db_path: str, max_size: str) -> None: self.conn.commit() self.max_size = max_size - def get(self, key: str) -> str | None: + def get(self, key: str) -> Optional[str]: """Returns the value associated with the given key, or None if the key is not in the cache.""" assert not self.closed self.cursor.execute("SELECT value FROM cache WHERE key=?", (key,))