Skip to content

Commit f347e06

Browse files
committed
Made linters happy
1 parent cfde0f2 commit f347e06

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

redis/lock.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import threading
42
import time as mod_time
53
import uuid
@@ -77,7 +75,7 @@ class Lock:
7775

7876
def __init__(
7977
self,
80-
redis: "Redis",
78+
redis,
8179
name: str,
8280
*,
8381
timeout: Optional[Number] = None,
@@ -166,7 +164,7 @@ def __exit__(
166164
self,
167165
exc_type: Optional[Type[BaseException]],
168166
exc_value: Optional[BaseException],
169-
traceback: Optional[TracebackType]
167+
traceback: Optional[TracebackType],
170168
) -> None:
171169
self.release()
172170

@@ -176,7 +174,7 @@ def acquire(
176174
sleep: Optional[Number] = None,
177175
blocking: Optional[bool] = None,
178176
blocking_timeout: Optional[Number] = None,
179-
token: Optional[str] = None
177+
token: Optional[str] = None,
180178
):
181179
"""
182180
Use Redis to hold a shared, distributed lock named ``name``.

redis/typing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
AnyFieldT = TypeVar("AnyFieldT", bytes, str, memoryview)
3939
AnyChannelT = TypeVar("AnyChannelT", bytes, str, memoryview)
4040

41+
4142
class CommandsProtocol(Protocol):
4243
connection_pool: Union["AsyncConnectionPool", "ConnectionPool"]
4344

tests/test_lock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def test_context_manager(self, r):
117117
assert r.get("foo") is None
118118

119119
def test_context_manager_blocking_timeout(self, r):
120-
with self.get_lock(r, "foo", blocking=False) as lock1:
120+
with self.get_lock(r, "foo", blocking=False):
121121
bt = 0.4
122122
sleep = 0.05
123123
lock2 = self.get_lock(r, "foo", sleep=sleep, blocking_timeout=bt)

0 commit comments

Comments
 (0)