Skip to content

Commit 2aeb71f

Browse files
committed
simplify code of interfaces.get_hashval()
1 parent d3f3f49 commit 2aeb71f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nipype/interfaces/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,13 +567,12 @@ def get_hashval(self, hash_method=None):
567567

568568
dict_withhash = []
569569
dict_nofilename = []
570-
571570
for name, val in sorted(self.get_traitsfree().items()):
572571
if self.has_metadata(name, "nohash", True):
573572
continue
574573

575-
hash_files = (not has_metadata(name, "hash_files", False) and not
576-
has_metadata(name, "name_source"))
574+
hash_files = (not self.has_metadata(name, "hash_files", False) and not
575+
self.has_metadata(name, "name_source"))
577576
dict_nofilename.append((name,
578577
self._get_sorteddict(val, hash_method=hash_method,
579578
hash_files=hash_files)))
@@ -582,6 +581,7 @@ def get_hashval(self, hash_method=None):
582581
hash_files=hash_files)))
583582
return dict_withhash, md5(encode_dict(dict_nofilename).encode()).hexdigest()
584583

584+
585585
def _get_sorteddict(self, theobject, dictwithhash=False, hash_method=None,
586586
hash_files=True):
587587
if isinstance(theobject, dict):

0 commit comments

Comments
 (0)