summaryrefslogtreecommitdiff
path: root/lib/extras.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/extras.py')
-rw-r--r--lib/extras.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/extras.py b/lib/extras.py
index 91ab9ab..67a67f2 100644
--- a/lib/extras.py
+++ b/lib/extras.py
@@ -306,7 +306,7 @@ try:
"""Create the UUID type and an uuid.UUID adapter."""
if not oid: oid = 2950
_ext.UUID = _ext.new_type((oid, ), "UUID",
- lambda data, cursor: uuid.UUID(data))
+ lambda data, cursor: data and uuid.UUID(data) or None)
_ext.register_type(_ext.UUID)
_ext.register_adapter(uuid.UUID, UUID_adapter)
return _ext.UUID
@@ -321,4 +321,4 @@ except ImportError, e:
raise e
-__all__ = [ k for k in locals().keys() if not k.startswith('_') ] \ No newline at end of file
+__all__ = [ k for k in locals().keys() if not k.startswith('_') ]