From c5574617326d40d9d7de1a046a8629320ea85ad3 Mon Sep 17 00:00:00 2001 From: Douglas RAILLARD Date: Tue, 2 Apr 2019 15:45:46 +0100 Subject: [PATCH] exekall: Make serialization test more robust pickle.dumps() seems to also raise AttributeError sometimes, in addition to pickle.PickleError: AttributeError: Can't pickle local object 'SpawnBase.__init__..write_to_stdout --- tools/exekall/exekall/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/exekall/exekall/_utils.py b/tools/exekall/exekall/_utils.py index 892de26f1..d5c3e2531 100644 --- a/tools/exekall/exekall/_utils.py +++ b/tools/exekall/exekall/_utils.py @@ -164,7 +164,7 @@ def is_serializable(obj, raise_excep=False): # This may be slow for big objects but it is the only way to be sure # it can actually be serialized pickle.dumps(obj) - except (TypeError, pickle.PickleError) as e: + except (TypeError, pickle.PickleError, AttributeError) as e: debug('Cannot serialize instance of {}: {}'.format( type(obj).__qualname__, str(e) )) -- GitLab