def __setstate__(self, d):
    """Called when unpickling which is integral to multiprocessing."""
    self.__dict__ = d 

    if 'cache' in d:
      self.init_submodules(d['cache'].enabled)
    else:
      self.init_submodules(False)
    
    pid = os.getpid()
    if 'pid' in d and d['pid'] != pid:
      # otherwise the pickle might have references to old connections
      reset_connection_pools() 
      self.pid = pid
def __setstate__ ( self , d ) : self . __dict__ = d if 'cache' in d : self . init_submodules ( d [ 'cache' ] . enabled ) else : self . init_submodules ( False ) pid = os . getpid ( ) if 'pid' in d and d [ 'pid' ] != pid : reset_connection_pools ( ) self . pid = pid
Called when unpickling which is integral to multiprocessing.