Skip to content
Merged
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
9 changes: 6 additions & 3 deletions deapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,15 @@ def connect(self, host: str = "127.0.0.1", port: int = 13240, read_only=False):

version = [int(part) for part in server_version[:4]]
temp = version[2] + version[1] * 1000 + version[0] * 1000000
if temp >= 2007005:
## version after 2.7.5
if (temp >= 2007005 and version[3] < 11274) or temp >= 2008000:
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic number 11274 lacks explanation. Add a comment explaining why this specific build number is the threshold for version 2.7.5, or define it as a named constant for clarity.

Copilot uses AI. Check for mistakes.
## version after 2.8.0
self.commandVersion = 15
elif temp >= 2007004:
## version after 2.7.4
self.commandVersion = 13
if version[3] < 10590:
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic number 10590 lacks explanation. Add a comment explaining why this specific build number is the threshold for version 2.7.4, or define it as a named constant for clarity.

Copilot uses AI. Check for mistakes.
self.commandVersion = 12
else:
self.commandVersion = 13
elif temp >= 2007003:
## version after 2.7.3
self.commandVersion = 11
Expand Down
Loading