Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #1554

Merged
merged 2 commits into from
Jun 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
rev: v2.34.0
hooks:
- id: pyupgrade
args: ["--py37-plus"]
Expand All @@ -16,7 +16,7 @@ repos:
- id: yesqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.3.0
hooks:
- id: check-merge-conflict
- id: check-toml
Expand Down
2 changes: 1 addition & 1 deletion kombu/asynchronous/http/curl.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def _setup_request(self, curl, request, buffer, headers, _pycurl=pycurl):
setopt(meth, True)

if request.method in ('POST', 'PUT'):
body = request.body.encode('utf-8') if request.body else bytes()
body = request.body.encode('utf-8') if request.body else b''
reqbuffer = BytesIO(body)
setopt(_pycurl.READFUNCTION, reqbuffer.read)
if request.method == 'POST':
Expand Down
8 changes: 4 additions & 4 deletions kombu/matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class MatcherRegistry:
matcher_pattern_first = ["pcre", ]

def __init__(self) -> None:
self._matchers: Dict[str, MatcherFunction] = {}
self._default_matcher: Optional[MatcherFunction] = None
self._matchers: dict[str, MatcherFunction] = {}
self._default_matcher: MatcherFunction | None = None

def register(self, name: str, matcher: MatcherFunction) -> None:
"""Add matcher by name to the registry."""
Expand Down Expand Up @@ -60,8 +60,8 @@ def match(
self,
data: bytes,
pattern: bytes,
matcher: Optional[str] = None,
matcher_kwargs: Optional[Dict[str, str]] = None
matcher: str | None = None,
matcher_kwargs: dict[str, str] | None = None
) -> bool:
"""Call the matcher."""
if matcher and not self._matchers.get(matcher):
Expand Down