Skip to content

Commit 6b6ffe6

Browse files
authored
fix(core): '"is" with a literal' syntax errors (#609)
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
1 parent eddc097 commit 6b6ffe6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kazoo/protocol/serialization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def deserialize(cls, bytes, offset):
111111
password, offset = read_buffer(bytes, offset)
112112

113113
try:
114-
read_only = bool_struct.unpack_from(bytes, offset)[0] is 1
114+
read_only = bool_struct.unpack_from(bytes, offset)[0] == 1
115115
offset += bool_struct.size
116116
except struct.error:
117117
read_only = False
@@ -446,4 +446,4 @@ def serialize(self):
446446
def deserialize(cls, bytes, offset):
447447
t, done, err = multiheader_struct.unpack_from(bytes, offset)
448448
offset += multiheader_struct.size
449-
return cls(t, done is 1, err), offset
449+
return cls(t, done == 1, err), offset

0 commit comments

Comments
 (0)