From 1d8badec1fca8b6d83f47a5e52449ae893cf4709 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 20 Mar 2019 12:02:28 -0500 Subject: [PATCH] Improve pdict error printing (closes #6 on gitlab) --- pytools/persistent_dict.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pytools/persistent_dict.py b/pytools/persistent_dict.py index 741afb6..89a2ebf 100644 --- a/pytools/persistent_dict.py +++ b/pytools/persistent_dict.py @@ -642,8 +642,9 @@ class WriteOncePersistentDict(_PersistentDictBase): self._warn("pytools.persistent_dict.WriteOncePersistentDict(%s) " "encountered an invalid " "key file for key %s. Remove the directory " - "'%s' if necessary. (caught: %s)" - % (self.identifier, hexdigest_key, item_dir, str(e)), + "'%s' if necessary. (caught: %s: %s)" + % (self.identifier, hexdigest_key, item_dir, + type(e).__name__, str(e)), stacklevel=1 + _stacklevel) raise NoSuchEntryError(key) -- GitLab