Skip to content

Commit

Permalink
six importing work around restore
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenk committed Aug 18, 2017
1 parent 09cf41e commit 7ad278a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/pyspark/cloudpickle.py
Expand Up @@ -322,7 +322,12 @@ def save_function(self, obj, name=None):

if name is None:
name = obj.__name__
modname = pickle.whichmodule(obj, name)
try:
# whichmodule() could fail, see
# https://bitbucket.org/gutworth/six/issues/63/importing-six-breaks-pickling
modname = pickle.whichmodule(obj, name)
except Exception:
modname = None
# print('which gives %s %s %s' % (modname, obj, name))
try:
themodule = sys.modules[modname]
Expand Down

0 comments on commit 7ad278a

Please sign in to comment.