From 89a8864f9f7000b14de608d3bdbb21bd8d0e0364 Mon Sep 17 00:00:00 2001 From: Timothy Zhang Date: Fri, 10 Apr 2015 16:13:25 +0800 Subject: [PATCH] marshal None --- silverberg/marshal.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/silverberg/marshal.py b/silverberg/marshal.py index ac50628..ff5b23c 100644 --- a/silverberg/marshal.py +++ b/silverberg/marshal.py @@ -76,6 +76,8 @@ def marshal(term): # If the datetime is naive, then it is considered UTC time and stored. If it is # timezone-aware, then its corresponding UTC time is stored return str(int(calendar.timegm(term.utctimetuple()) * 1000 + term.microsecond / 1e3)) + elif term is None: + return "null" else: return str(term)