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 "
@@ -905,7 +891,12 @@ async def read_response(
905
891
"""Read the response from a previously sent command"""
906
892
read_timeout = timeout if timeout is not None else self .socket_timeout
907
893
try :
908
- async with async_timeout .timeout (read_timeout ):
894
+ if read_timeout is not None :
895
+ async with async_timeout .timeout (read_timeout ):
896
+ response = await self ._parser .read_response (
897
+ disable_decoding = disable_decoding
898
+ )
899
+ else :
909
900
response = await self ._parser .read_response (
910
901
disable_decoding = disable_decoding
911
902
)
You can’t perform that action at this time.
0 commit comments