Skip to content

Commit 477230f

Browse files
include full kwargs
1 parent a58ff32 commit 477230f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

redis/connection.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,15 +1425,11 @@ def __init__(
14251425
self.reset()
14261426

14271427
def __repr__(self) -> str:
1428-
arg = ""
1429-
if "host" in self.connection_kwargs:
1430-
arg = f"{self.connection_kwargs['host']}:{self.connection_kwargs['port']}"
1431-
elif "path" in self.connection_kwargs:
1432-
arg = self.connection_kwargs["path"]
1433-
1428+
conn_kwargs = ",".join([f"{k}={v}" for k, v in self.connection_kwargs.items()])
14341429
return (
14351430
f"<{type(self).__module__}.{type(self).__name__}"
1436-
f"({self.connection_class.__name__}<{arg}>)>"
1431+
f"({self.connection_class.__module__}.{self.connection_class.__name__}"
1432+
f"({conn_kwargs}))>"
14371433
)
14381434

14391435
def get_protocol(self):

0 commit comments

Comments
 (0)