Skip to content

Commit

Permalink
Merge pull request #104 from pallets-eco/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
davidism committed Oct 10, 2022
2 parents 2a8b115 + c2695f0 commit e06d58d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ repos:
- id: reorder-python-imports
args: ["--application-directories", "src"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
rev: v3.0.0
hooks:
- id: pyupgrade
- repo: https://github.com/psf/black
rev: 22.8.0
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
Expand Down
4 changes: 2 additions & 2 deletions src/secure_cookie/cookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _date_to_unix(arg):
return seconds


class _JSONModule(object):
class _JSONModule:
@classmethod
def dumps(cls, obj, **kw):
kw.setdefault("separators", (",", ":"))
Expand Down Expand Up @@ -197,7 +197,7 @@ class SecureCookie(ModificationTrackingDict):
quote_base64 = True

def __init__(self, data=None, secret_key=None, new=True):
super(SecureCookie, self).__init__(data or ())
super().__init__(data or ())

if secret_key is not None:
secret_key = to_bytes(secret_key, "utf-8")
Expand Down
14 changes: 7 additions & 7 deletions src/secure_cookie/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def on_update(self):
self.modified = True

self.modified = False
super(ModificationTrackingDict, self).__init__(on_update=on_update)
super().__init__(on_update=on_update)
dict.update(self, *args, **kwargs)

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

def __init__(self, data, sid, new=False):
super(Session, self).__init__(data)
super().__init__(data)
self.sid = sid
self.new = new

Expand All @@ -162,7 +162,7 @@ def should_save(self):
return self.modified


class SessionStore(object):
class SessionStore:
"""Base class for all session stores.
:param session_class: The session class to use.
Expand Down Expand Up @@ -231,7 +231,7 @@ def __init__(
renew_missing=False,
mode=0o644,
):
super(FilesystemSessionStore, self).__init__(session_class=session_class)
super().__init__(session_class=session_class)

if path:
try:
Expand Down Expand Up @@ -269,7 +269,7 @@ def save(self, session):
try:
os.rename(tmp, fn)
os.chmod(fn, self.mode)
except (IOError, OSError): # noqa: B014
except OSError: # noqa: B014
pass

def delete(self, session):
Expand All @@ -286,7 +286,7 @@ def get(self, sid):

try:
f = open(self.get_session_filename(sid), "rb")
except IOError:
except OSError:
if self.renew_missing:
return self.new()

Expand Down Expand Up @@ -319,7 +319,7 @@ def list(self):
return result


class SessionMiddleware(object):
class SessionMiddleware:
"""A middleware that puts the session object of a store into the
WSGI environ. It automatically sets cookies and restores sessions.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_wrapper_support():


def test_json():
class JSONCompat(object):
class JSONCompat:
dumps = staticmethod(json.dumps)

@staticmethod
Expand Down

0 comments on commit e06d58d

Please sign in to comment.