File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 11import asyncio
2- import contextlib
32import copy
43import enum
54import inspect
5554if HIREDIS_AVAILABLE :
5655 import hiredis
5756
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-
7157SYM_STAR = b"*"
7258SYM_DOLLAR = b"$"
7359SYM_CRLF = b"\r \n "
@@ -891,7 +877,12 @@ async def read_response(
891877 """Read the response from a previously sent command"""
892878 read_timeout = timeout if timeout is not None else self .socket_timeout
893879 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 :
895886 response = await self ._parser .read_response (
896887 disable_decoding = disable_decoding
897888 )
You can’t perform that action at this time.
0 commit comments