File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 3
3
import sys
4
4
import numpy as np
5
5
import pandas
6
+ import copy
6
7
import pickle as pkl
7
8
from pandas import compat
8
9
from pandas .compat import u , string_types
@@ -29,7 +30,7 @@ def load_reduce(self):
29
30
except :
30
31
31
32
# try to reencode the arguments
32
- if self . encoding is not None :
33
+ if getattr ( self , ' encoding' , None ) is not None :
33
34
args = tuple ([arg .encode (self .encoding )
34
35
if isinstance (arg , string_types )
35
36
else arg for arg in args ])
@@ -39,7 +40,7 @@ def load_reduce(self):
39
40
except :
40
41
pass
41
42
42
- if self . is_verbose :
43
+ if getattr ( self , ' is_verbose' , None ) :
43
44
print (sys .exc_info ())
44
45
print (func , args )
45
46
raise
@@ -53,6 +54,7 @@ class Unpickler(pkl._Unpickler):
53
54
class Unpickler (pkl .Unpickler ):
54
55
pass
55
56
57
+ Unpickler .dispatch = copy .copy (Unpickler .dispatch )
56
58
Unpickler .dispatch [pkl .REDUCE [0 ]] = load_reduce
57
59
58
60
You can’t perform that action at this time.
0 commit comments