1818import gzip
1919import lzma
2020import os
21+ import pickle
2122import shutil
2223from warnings import catch_warnings , simplefilter
2324import zipfile
@@ -217,37 +218,20 @@ def test_pickles(current_pickle_data, legacy_pickle):
217218
218219def test_round_trip_current (current_pickle_data ):
219220
220- try :
221- import cPickle as c_pickle
222-
223- def c_pickler (obj , path ):
224- with open (path , 'wb' ) as fh :
225- c_pickle .dump (obj , fh , protocol = - 1 )
226-
227- def c_unpickler (path ):
228- with open (path , 'rb' ) as fh :
229- fh .seek (0 )
230- return c_pickle .load (fh )
231- except ImportError :
232- c_pickler = None
233- c_unpickler = None
234-
235- import pickle as python_pickle
236-
237221 def python_pickler (obj , path ):
238222 with open (path , 'wb' ) as fh :
239- python_pickle .dump (obj , fh , protocol = - 1 )
223+ pickle .dump (obj , fh , protocol = - 1 )
240224
241225 def python_unpickler (path ):
242226 with open (path , 'rb' ) as fh :
243227 fh .seek (0 )
244- return python_pickle .load (fh )
228+ return pickle .load (fh )
245229
246230 data = current_pickle_data
247231 for typ , dv in data .items ():
248232 for dt , expected in dv .items ():
249233
250- for writer in [pd .to_pickle , c_pickler , python_pickler ]:
234+ for writer in [pd .to_pickle , python_pickler ]:
251235 if writer is None :
252236 continue
253237
@@ -260,10 +244,6 @@ def python_unpickler(path):
260244 result = pd .read_pickle (path )
261245 compare_element (result , expected , typ )
262246
263- if c_unpickler is not None :
264- result = c_unpickler (path )
265- compare_element (result , expected , typ )
266-
267247 result = python_unpickler (path )
268248 compare_element (result , expected , typ )
269249
0 commit comments