File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 33import sys
44import numpy as np
55import pandas
6+ import copy
67import pickle as pkl
78from pandas import compat
89from pandas .compat import u , string_types
@@ -29,7 +30,7 @@ def load_reduce(self):
2930 except :
3031
3132 # try to reencode the arguments
32- if self . encoding is not None :
33+ if getattr ( self , ' encoding' , None ) is not None :
3334 args = tuple ([arg .encode (self .encoding )
3435 if isinstance (arg , string_types )
3536 else arg for arg in args ])
@@ -39,7 +40,7 @@ def load_reduce(self):
3940 except :
4041 pass
4142
42- if self . is_verbose :
43+ if getattr ( self , ' is_verbose' , None ) :
4344 print (sys .exc_info ())
4445 print (func , args )
4546 raise
@@ -53,6 +54,7 @@ class Unpickler(pkl._Unpickler):
5354 class Unpickler (pkl .Unpickler ):
5455 pass
5556
57+ Unpickler .dispatch = copy .copy (Unpickler .dispatch )
5658Unpickler .dispatch [pkl .REDUCE [0 ]] = load_reduce
5759
5860
You can’t perform that action at this time.
0 commit comments