diff options
Diffstat (limited to 'src/engine/SCons/Sig/MD5.py')
-rw-r--r-- | src/engine/SCons/Sig/MD5.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/engine/SCons/Sig/MD5.py b/src/engine/SCons/Sig/MD5.py index c2331bd..251c1eb 100644 --- a/src/engine/SCons/Sig/MD5.py +++ b/src/engine/SCons/Sig/MD5.py @@ -78,12 +78,9 @@ def collect(signatures): def signature(obj): """Generate a signature for an object """ - try: - contents = str(obj.get_contents()) - except AttributeError, e: - raise AttributeError, \ - "unable to fetch contents of '%s': %s" % (str(obj), e) - return hexdigest(md5.new(contents).digest()) + if not hasattr(obj, 'get_contents'): + raise AttributeError, "unable to fetch contents of '%s'" % str(obj) + return hexdigest(md5.new(str(obj.get_contents())).digest()) def to_string(signature): """Convert a signature to a string""" |