Skip to content

Commit e06d58d

Browse files
authored
Merge pull request #104 from pallets-eco/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents 2a8b115 + c2695f0 commit e06d58d

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ repos:
55
- id: reorder-python-imports
66
args: ["--application-directories", "src"]
77
- repo: https://github.com/asottile/pyupgrade
8-
rev: v2.38.2
8+
rev: v3.0.0
99
hooks:
1010
- id: pyupgrade
1111
- repo: https://github.com/psf/black
12-
rev: 22.8.0
12+
rev: 22.10.0
1313
hooks:
1414
- id: black
1515
- repo: https://github.com/PyCQA/flake8

src/secure_cookie/cookie.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _date_to_unix(arg):
134134
return seconds
135135

136136

137-
class _JSONModule(object):
137+
class _JSONModule:
138138
@classmethod
139139
def dumps(cls, obj, **kw):
140140
kw.setdefault("separators", (",", ":"))
@@ -197,7 +197,7 @@ class SecureCookie(ModificationTrackingDict):
197197
quote_base64 = True
198198

199199
def __init__(self, data=None, secret_key=None, new=True):
200-
super(SecureCookie, self).__init__(data or ())
200+
super().__init__(data or ())
201201

202202
if secret_key is not None:
203203
secret_key = to_bytes(secret_key, "utf-8")

src/secure_cookie/session.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def on_update(self):
119119
self.modified = True
120120

121121
self.modified = False
122-
super(ModificationTrackingDict, self).__init__(on_update=on_update)
122+
super().__init__(on_update=on_update)
123123
dict.update(self, *args, **kwargs)
124124

125125
def copy(self):
@@ -145,7 +145,7 @@ class Session(ModificationTrackingDict):
145145
__slots__ = ModificationTrackingDict.__slots__ + ("sid", "new")
146146

147147
def __init__(self, data, sid, new=False):
148-
super(Session, self).__init__(data)
148+
super().__init__(data)
149149
self.sid = sid
150150
self.new = new
151151

@@ -162,7 +162,7 @@ def should_save(self):
162162
return self.modified
163163

164164

165-
class SessionStore(object):
165+
class SessionStore:
166166
"""Base class for all session stores.
167167
168168
:param session_class: The session class to use.
@@ -231,7 +231,7 @@ def __init__(
231231
renew_missing=False,
232232
mode=0o644,
233233
):
234-
super(FilesystemSessionStore, self).__init__(session_class=session_class)
234+
super().__init__(session_class=session_class)
235235

236236
if path:
237237
try:
@@ -269,7 +269,7 @@ def save(self, session):
269269
try:
270270
os.rename(tmp, fn)
271271
os.chmod(fn, self.mode)
272-
except (IOError, OSError): # noqa: B014
272+
except OSError: # noqa: B014
273273
pass
274274

275275
def delete(self, session):
@@ -286,7 +286,7 @@ def get(self, sid):
286286

287287
try:
288288
f = open(self.get_session_filename(sid), "rb")
289-
except IOError:
289+
except OSError:
290290
if self.renew_missing:
291291
return self.new()
292292

@@ -319,7 +319,7 @@ def list(self):
319319
return result
320320

321321

322-
class SessionMiddleware(object):
322+
class SessionMiddleware:
323323
"""A middleware that puts the session object of a store into the
324324
WSGI environ. It automatically sets cookies and restores sessions.
325325

tests/test_cookie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_wrapper_support():
7272

7373

7474
def test_json():
75-
class JSONCompat(object):
75+
class JSONCompat:
7676
dumps = staticmethod(json.dumps)
7777

7878
@staticmethod

0 commit comments

Comments
 (0)