File tree 3 files changed +9
-6
lines changed
3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change
1
+ * asyncio: Fix memory leak caused by hiredis (#2693)
1
2
* Allow data to drain from async PythonParser when reading during a disconnect()
2
3
* Use asyncio.timeout() instead of async_timeout.timeout() for python >= 3.11 (#2602)
3
4
* Add test and fix async HiredisParser when reading during a disconnect() (#2349)
Original file line number Diff line number Diff line change @@ -187,12 +187,13 @@ def __del__(self):
187
187
except Exception :
188
188
pass
189
189
190
- def parse_error (self , response : str ) -> ResponseError :
190
+ @classmethod
191
+ def parse_error (cls , response : str ) -> ResponseError :
191
192
"""Parse an error response"""
192
193
error_code = response .split (" " )[0 ]
193
- if error_code in self .EXCEPTION_CLASSES :
194
+ if error_code in cls .EXCEPTION_CLASSES :
194
195
response = response [len (error_code ) + 1 :]
195
- exception_class = self .EXCEPTION_CLASSES [error_code ]
196
+ exception_class = cls .EXCEPTION_CLASSES [error_code ]
196
197
if isinstance (exception_class , dict ):
197
198
exception_class = exception_class .get (response , ResponseError )
198
199
return exception_class (response )
Original file line number Diff line number Diff line change @@ -158,12 +158,13 @@ class BaseParser:
158
158
"NOPERM" : NoPermissionError ,
159
159
}
160
160
161
- def parse_error (self , response ):
161
+ @classmethod
162
+ def parse_error (cls , response ):
162
163
"Parse an error response"
163
164
error_code = response .split (" " )[0 ]
164
- if error_code in self .EXCEPTION_CLASSES :
165
+ if error_code in cls .EXCEPTION_CLASSES :
165
166
response = response [len (error_code ) + 1 :]
166
- exception_class = self .EXCEPTION_CLASSES [error_code ]
167
+ exception_class = cls .EXCEPTION_CLASSES [error_code ]
167
168
if isinstance (exception_class , dict ):
168
169
exception_class = exception_class .get (response , ResponseError )
169
170
return exception_class (response )
You can’t perform that action at this time.
0 commit comments