Skip to content

Commit

Permalink
Don't use NoneType, for 3.7 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanvalur committed Oct 5, 2023
1 parent 914e338 commit a9d8698
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/resp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import itertools
from contextlib import closing
from types import NoneType
from typing import Any, Generator, List, Optional, Tuple, Union

CRNL = b"\r\n"
Expand Down Expand Up @@ -145,7 +144,7 @@ def encode(self, data: Any, hint: Optional[str] = None) -> bytes:
return f",{data}\r\n".encode() # resp3 double
return f"+{data}\r\n".encode() # simple string

elif isinstance(data, NoneType):
elif data is None:
if self.protocol > 2:
return b"_\r\n" # resp3 null
return b"$-1\r\n" # Null bulk string
Expand Down

0 comments on commit a9d8698

Please sign in to comment.