def save_module_dict(pickler, obj): if obj is pickler._main_module.__dict__: if _DEBUG: print "D1: %s" % "<dict ...>" # obj pickler.write('c__builtin__\n__main__\n') else: if _DEBUG: print "D2: %s" % "<dict ...>" #obj StockPickler.save_dict(pickler, obj) return
def save_module_dict(pickler, obj): if is_dill(pickler) and obj is pickler._main_module.__dict__: log.info("D1: %s" % "<dict ...>") # obj pickler.write('c__builtin__\n__main__\n') elif not is_dill(pickler) and obj is _main_module.__dict__: log.info("D3: %s" % "<dict ...>") # obj pickler.write('c__main__\n__dict__\n') #XXX: works in general? else: log.info("D2: %s" % "<dict ...>") #obj StockPickler.save_dict(pickler, obj) return
def save_module_dict(pickler, obj): if is_dill(pickler) and obj is pickler._main_module.__dict__: pickler.write('c__builtin__\n__main__\n') elif not is_dill(pickler) and obj is _main_module.__dict__: pickler.write('c__main__\n__dict__\n') #XXX: works in general? else: StockPickler.save_dict(pickler, obj) return
def save_module_dict(pickler, obj): if obj is pickler._main_module.__dict__: pickler.write('c__builtin__\n__main__\n', obj=obj) else: Pickler.save_dict(pickler, obj)