18
18
import gzip
19
19
import lzma
20
20
import os
21
+ import pickle
21
22
import shutil
22
23
from warnings import catch_warnings , simplefilter
23
24
import zipfile
@@ -217,37 +218,20 @@ def test_pickles(current_pickle_data, legacy_pickle):
217
218
218
219
def test_round_trip_current (current_pickle_data ):
219
220
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
-
237
221
def python_pickler (obj , path ):
238
222
with open (path , 'wb' ) as fh :
239
- python_pickle .dump (obj , fh , protocol = - 1 )
223
+ pickle .dump (obj , fh , protocol = - 1 )
240
224
241
225
def python_unpickler (path ):
242
226
with open (path , 'rb' ) as fh :
243
227
fh .seek (0 )
244
- return python_pickle .load (fh )
228
+ return pickle .load (fh )
245
229
246
230
data = current_pickle_data
247
231
for typ , dv in data .items ():
248
232
for dt , expected in dv .items ():
249
233
250
- for writer in [pd .to_pickle , c_pickler , python_pickler ]:
234
+ for writer in [pd .to_pickle , python_pickler ]:
251
235
if writer is None :
252
236
continue
253
237
@@ -260,10 +244,6 @@ def python_unpickler(path):
260
244
result = pd .read_pickle (path )
261
245
compare_element (result , expected , typ )
262
246
263
- if c_unpickler is not None :
264
- result = c_unpickler (path )
265
- compare_element (result , expected , typ )
266
-
267
247
result = python_unpickler (path )
268
248
compare_element (result , expected , typ )
269
249
0 commit comments