File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 18
18
connections should require the server hostname to match the hostname
19
19
specified in the SSL cert. By default 'ssl_check_hostname' is False
20
20
for backwards compatibility. #1196
21
+ * Slightly optimized command packing. Thanks @Deneby67. #1255
21
22
* 3.3.11
22
23
* Further fix for the SSLError -> TimeoutError mapping to work
23
24
on obscure releases of Python 2.7.
Original file line number Diff line number Diff line change @@ -757,15 +757,16 @@ def pack_command(self, *args):
757
757
for arg in imap (self .encoder .encode , args ):
758
758
# to avoid large string mallocs, chunk the command into the
759
759
# output list if we're sending large values
760
- if len (buff ) > buffer_cutoff or len (arg ) > buffer_cutoff :
760
+ arg_length = len (arg )
761
+ if len (buff ) > buffer_cutoff or arg_length > buffer_cutoff :
761
762
buff = SYM_EMPTY .join (
762
- (buff , SYM_DOLLAR , str (len ( arg ) ).encode (), SYM_CRLF ))
763
+ (buff , SYM_DOLLAR , str (arg_length ).encode (), SYM_CRLF ))
763
764
output .append (buff )
764
765
output .append (arg )
765
766
buff = SYM_CRLF
766
767
else :
767
768
buff = SYM_EMPTY .join (
768
- (buff , SYM_DOLLAR , str (len ( arg ) ).encode (),
769
+ (buff , SYM_DOLLAR , str (arg_length ).encode (),
769
770
SYM_CRLF , arg , SYM_CRLF ))
770
771
output .append (buff )
771
772
return output
You can’t perform that action at this time.
0 commit comments