diff options
author | Reid D McKenzie <me@arrdem.com> | 2020-05-18 10:21:42 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-18 18:21:42 +0200 |
commit | 6b6ffe62a073d1ed5413c65c2d8ec94ea2fa1760 (patch) | |
tree | 3e281e1c432d07a1b9de72596f993a0241056bad | |
parent | eddc0976bf1ef9d9fb97990cebbc3f9b1abe9d7d (diff) | |
download | kazoo-6b6ffe62a073d1ed5413c65c2d8ec94ea2fa1760.tar.gz |
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
-rw-r--r-- | kazoo/protocol/serialization.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kazoo/protocol/serialization.py b/kazoo/protocol/serialization.py index 14ad71a..80fa4d1 100644 --- a/kazoo/protocol/serialization.py +++ b/kazoo/protocol/serialization.py @@ -111,7 +111,7 @@ class Connect(namedtuple('Connect', 'protocol_version last_zxid_seen' 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 @@ -446,4 +446,4 @@ class MultiHeader(namedtuple('MultiHeader', 'type done err')): 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 |