We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91be4a0 commit 5c4177fCopy full SHA for 5c4177f
redis/connection.py
@@ -1422,10 +1422,16 @@ def __init__(
1422
self._lock = threading.Lock()
1423
self.reset()
1424
1425
- def __repr__(self) -> (str, str):
+ def __repr__(self) -> str:
1426
+ arg = ""
1427
+ if "host" in self.connection_kwargs:
1428
+ arg = f"{self.connection_kwargs['host']}:{self.connection_kwargs['port']}"
1429
+ elif "path" in self.connection_kwargs:
1430
+ arg = self.connection_kwargs["path"]
1431
+
1432
return (
1433
f"<{type(self).__module__}.{type(self).__name__}"
- f"({repr(self.connection_class(**self.connection_kwargs))})>"
1434
+ f"({self.connection_class.__name__}<{arg}>)>"
1435
)
1436
1437
def get_protocol(self):
0 commit comments