Skip to content

Commit a5dde0f

Browse files
committed
Removed redundant checks associated with pack command
1 parent 9c2caf8 commit a5dde0f

File tree

3 files changed

+0
-21
lines changed

3 files changed

+0
-21
lines changed

redis/connection.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
from .utils import (
3939
CRYPTOGRAPHY_AVAILABLE,
4040
HIREDIS_AVAILABLE,
41-
HIREDIS_PACK_AVAILABLE,
4241
SSL_AVAILABLE,
4342
compare_versions,
4443
ensure_string,
@@ -314,8 +313,6 @@ def __del__(self):
314313
def _construct_command_packer(self, packer):
315314
if packer is not None:
316315
return packer
317-
elif HIREDIS_PACK_AVAILABLE:
318-
return HiredisRespSerializer()
319316
else:
320317
return PythonRespSerializer(self._buffer_cutoff, self.encoder.encode)
321318

redis/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
raise ImportError("hiredis package should be >= 3.0.0")
1313
except ImportError:
1414
HIREDIS_AVAILABLE = False
15-
HIREDIS_PACK_AVAILABLE = False
1615

1716
try:
1817
import ssl # noqa

tests/test_encoding.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pytest
22
import redis
33
from redis.connection import Connection
4-
from redis.utils import HIREDIS_PACK_AVAILABLE
54

65
from .conftest import _get_client
76

@@ -75,22 +74,6 @@ def test_replace(self, request):
7574
assert r.get("a") == "foo\ufffd"
7675

7776

78-
@pytest.mark.skipif(
79-
HIREDIS_PACK_AVAILABLE,
80-
reason="Packing via hiredis does not preserve memoryviews",
81-
)
82-
class TestMemoryviewsAreNotPacked:
83-
def test_memoryviews_are_not_packed(self):
84-
c = Connection()
85-
arg = memoryview(b"some_arg")
86-
arg_list = ["SOME_COMMAND", arg]
87-
cmd = c.pack_command(*arg_list)
88-
assert cmd[1] is arg
89-
cmds = c.pack_commands([arg_list, arg_list])
90-
assert cmds[1] is arg
91-
assert cmds[3] is arg
92-
93-
9477
class TestCommandsAreNotEncoded:
9578
@pytest.fixture()
9679
def r(self, request):

0 commit comments

Comments
 (0)