chore: Upgrade Python syntax with pyupgrade

Run with the following pre-commit configuration:

```
repos:
  - repo: https://github.com/asottile/pyupgrade
    rev: v3.1.0
    hooks:
      - id: pyupgrade
        args: [ "--py3-plus", "--py36-plus", "--py37-plus" ]
```

The rationale for every change can be found at https://github.com/asottile/pyupgrade
This commit is contained in:
Sondre Lillebø Gundersen authored and David Wobrock committed 2022-11-03 22:00:00 +01:00
1 parent 92eab3c929
commit bd4eb89b8c
29 files changed
+32 -65

No files matched your search

+3 -3
View File
@@ -6,20 +6,20 @@ class Cache(dict):
def __init__(self, django_folder, database, cache_path):
self.filename = os.path.join(
cache_path,
"{0}_{1}.pickle".format(django_folder.replace(os.sep, "_"), database),
"{}_{}.pickle".format(django_folder.replace(os.sep, "_"), database),
)
if not os.path.exists(os.path.dirname(self.filename)):
os.makedirs(os.path.dirname(self.filename))
super(Cache, self).__init__()
super().__init__()
def load(self):
try:
with open(self.filename, "rb") as f:
tmp_dict = pickle.load(f)
self.update(tmp_dict)
except IOError:
except OSError:
pass
def save(self):