Commit 516c8daa authored by payno's avatar payno
Browse files

[esrftaskgraph][hasing] handle case value us a Sized empty

parent 43e5386c
......@@ -3,6 +3,7 @@ import hashlib
from import Mapping, Iterable, Set
import numpy
from esrftaskgraph.utils import qualname
from collections import Sized
def uhashtype(_type):
......@@ -10,7 +11,7 @@ def uhashtype(_type):
def uhash(value, _hash=None):
"""Universial hash (as opposed to python's hash).
"""Universal hash (as opposed to python's hash).
This is an example. Must find something better.
:param value:
......@@ -22,7 +23,7 @@ def uhash(value, _hash=None):
if bdigest:
_hash = hashlib.sha256()
if value is None:
if value is None or isinstance(value, Sized) and len(value) == 0:
elif isinstance(value, UniversalHashable):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment