Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
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
Exemple #4
0
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
Exemple #5
0
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)
Exemple #6
0
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)