def load_compatibility(filename):
 with open(filename, 'rb') as file_handle:
  unpickler = ZipNumpyUnpickler(filename, file_handle=file_handle)
  try:
   obj = unpickler.load()
  except UnicodeDecodeError as exc:
   if PY3_OR_LATER:
    new_exc = ValueError('You may be trying to read with python 3 a joblib pickle generated with python 2. This feature is not supported by joblib.')
    new_exc.__cause__ = exc
    raise new_exc
  finally:
   if hasattr(unpickler, 'file_handle'):
    unpickler.file_handle.close()
  return obj

def load_compatibility ( filename ) : with open ( filename , 'rb' ) as file_handle : unpickler = ZipNumpyUnpickler ( filename , file_handle = file_handle ) try : obj = unpickler . load ( ) except UnicodeDecodeError as exc : if PY3_OR_LATER : new_exc = ValueError ( 'You may be trying to read with python 3 a joblib pickle generated with python 2. This feature is not supported by joblib.' ) new_exc . __cause__ = exc raise new_exc finally : if hasattr ( unpickler , 'file_handle' ) : unpickler . file_handle . close ( ) return obj
reconstruct a python object from a file persisted with joblib .