chore: Embrace the walrus operator (#24127)

This commit is contained in:
John Bodley
2023-05-19 00:37:13 -07:00
committed by GitHub
parent 6b5459121f
commit d583ca9ef5
54 changed files with 100 additions and 185 deletions

View File

@@ -121,8 +121,7 @@ class BaseScreenshot:
@staticmethod
def get_from_cache_key(cache: Cache, cache_key: str) -> Optional[BytesIO]:
logger.info("Attempting to get from cache: %s", cache_key)
payload = cache.get(cache_key)
if payload:
if payload := cache.get(cache_key):
return BytesIO(payload)
logger.info("Failed at getting from cache: %s", cache_key)
return None