Skip to content

Commit

Permalink
Fix '"is" with a literal' syntax warnings
Browse files Browse the repository at this point in the history
As of Python 3.8, "is" with a literal is a syntax warning and may become
an error in the future. Kazoo ran afoul of this in a few places however.
  • Loading branch information
arrdem committed May 8, 2020
1 parent b880ae6 commit 6a586a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kazoo/protocol/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def deserialize(cls, bytes, offset):
password, offset = read_buffer(bytes, offset)

try:
read_only = bool_struct.unpack_from(bytes, offset)[0] is 1
read_only = bool_struct.unpack_from(bytes, offset)[0] == 1
offset += bool_struct.size
except struct.error:
read_only = False
Expand Down Expand Up @@ -446,4 +446,4 @@ def serialize(self):
def deserialize(cls, bytes, offset):
t, done, err = multiheader_struct.unpack_from(bytes, offset)
offset += multiheader_struct.size
return cls(t, done is 1, err), offset
return cls(t, done == 1, err), offset

0 comments on commit 6a586a6

Please sign in to comment.