File tree 1 file changed +6
-15
lines changed
1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 1
1
import asyncio
2
- import contextlib
3
2
import copy
4
3
import enum
5
4
import inspect
55
54
if HIREDIS_AVAILABLE :
56
55
import hiredis
57
56
58
- if sys .version_info [:2 ] >= (3 , 10 ):
59
- nullcontext = contextlib .nullcontext ()
60
- else :
61
-
62
- class NullContext :
63
- async def __aenter__ (self ):
64
- pass
65
-
66
- async def __aexit__ (self , * args ):
67
- pass
68
-
69
- nullcontext = NullContext ()
70
-
71
57
SYM_STAR = b"*"
72
58
SYM_DOLLAR = b"$"
73
59
SYM_CRLF = b"\r \n "
@@ -891,7 +877,12 @@ async def read_response(
891
877
"""Read the response from a previously sent command"""
892
878
read_timeout = timeout if timeout is not None else self .socket_timeout
893
879
try :
894
- async with async_timeout .timeout (read_timeout ):
880
+ if read_timeout is not None :
881
+ async with async_timeout .timeout (read_timeout ):
882
+ response = await self ._parser .read_response (
883
+ disable_decoding = disable_decoding
884
+ )
885
+ else :
895
886
response = await self ._parser .read_response (
896
887
disable_decoding = disable_decoding
897
888
)
You can’t perform that action at this time.
0 commit comments