File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -101,15 +101,8 @@ def to_pickle(
101101 is_text = False ,
102102 storage_options = storage_options ,
103103 ) as handles :
104- if handles .compression ["method" ] in ("bz2" , "xz" ) and protocol >= 5 :
105- # some weird TypeError GH#39002 with pickle 5: fallback to letting
106- # pickle create the entire object and then write it to the buffer.
107- # "zip" would also be here if pandas.io.common._BytesZipFile
108- # wouldn't buffer write calls
109- handles .handle .write (pickle .dumps (obj , protocol = protocol ))
110- else :
111- # letting pickle write directly to the buffer is more memory-efficient
112- pickle .dump (obj , handles .handle , protocol = protocol )
104+ # letting pickle write directly to the buffer is more memory-efficient
105+ pickle .dump (obj , handles .handle , protocol = protocol )
113106
114107
115108@doc (
You can’t perform that action at this time.
0 commit comments