diff --git a/dill/_dill.py b/dill/_dill.py index b4887ce8..0869d766 100644 --- a/dill/_dill.py +++ b/dill/_dill.py @@ -2210,7 +2210,6 @@ def save_function(pickler, obj): if not _locate_function(obj, pickler): log.info("F1: %s" % obj) _recurse = getattr(pickler, '_recurse', None) - _byref = getattr(pickler, '_byref', None) _postproc = getattr(pickler, '_postproc', None) _main_modified = getattr(pickler, '_main_modified', None) _original_main = getattr(pickler, '_original_main', __builtin__)#'None' diff --git a/tests/test_classdef.py b/tests/test_classdef.py index 52323441..c6522ebc 100644 --- a/tests/test_classdef.py +++ b/tests/test_classdef.py @@ -228,6 +228,15 @@ def test_origbases(): if sys.hexversion >= 0x03070000: assert dill.copy(customIntList).__orig_bases__ == customIntList.__orig_bases__ +def test_attr(): + import attr + @attr.s + class A: + a = attr.ib() + + v = A(1) + assert dill.copy(v) == v + def test_metaclass(): if dill._dill.PY3: class metaclass_with_new(type):