Code improvement

This commit is contained in:
Koen van Zuijlen 2020-12-30 17:12:32 +01:00
parent e9bef6db68
commit 36b2eeb297

View file

@ -785,7 +785,7 @@ class _ShelfCacheBackend:
"""Used as a backend for caching cacheable requests.""" """Used as a backend for caching cacheable requests."""
def __init__(self, file_path=None, flag=None): def __init__(self, file_path=None, flag=None):
if flag: if flag is not None:
self.shelf = shelve.open(file_path, flag=flag) self.shelf = shelve.open(file_path, flag=flag)
else: else:
self.shelf = shelve.open(file_path) self.shelf = shelve.open(file_path)