Page MenuHomeSoftware Heritage

D559.diff
No OneTemporary

D559.diff

diff --git a/swh/core/serializers.py b/swh/core/serializers.py
--- a/swh/core/serializers.py
+++ b/swh/core/serializers.py
@@ -178,7 +178,11 @@
if b'__uuid__' in obj and obj[b'__uuid__']:
return UUID(obj[b's'])
if b'__timedelta__' in obj and obj[b'__timedelta__']:
- return datetime.timedelta(**obj[b's'])
+ # for backward compatibility with old serialization method
+ if isinstance(obj[b's'], str):
+ return eval(obj[b's'])
+ else:
+ return datetime.timedelta(**obj[b's'])
if b'__arrow__' in obj and obj[b'__arrow__']:
return arrow.get(obj[b's'])
return obj

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 3, 4:33 PM (3 w, 6 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222642

Event Timeline