Skip to content

Commit

Permalink
fix(core): '"is" with a literal' syntax errors (#609)
Browse files Browse the repository at this point in the history
As of Python 3.8, "is" with a literal is a syntax warning because of the
confusion between equality and instance identity it represents.

Issue #607
  • Loading branch information
arrdem authored May 18, 2020
1 parent eddc097 commit 6b6ffe6
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 6b6ffe6

Please sign in to comment.