Skip to content

Commit e6eefc1

Browse files
committed
fix: do not log in utils
1 parent f2f0280 commit e6eefc1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

heudiconv/cli/run.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,10 @@ def process_args(args):
256256
args.bids)
257257
continue
258258

259-
anon_sid = anonymize_sid(sid, args.anon_cmd)
259+
anon_sid = anonymize_sid(sid, args.anon_cmd) if args.anon_cmd else None
260+
if args.anon_cmd:
261+
lgr.info('Anonymized {} to {}'.format(sid, anon_sid))
262+
260263
study_outdir = op.join(outdir, locator or '')
261264
anon_outdir = args.conv_outdir or outdir
262265
anon_study_outdir = op.join(anon_outdir, locator or '')

heudiconv/utils.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,9 @@ def dec(obj):
9898

9999

100100
def anonymize_sid(sid, anon_sid_cmd):
101-
if anon_sid_cmd is not None:
102-
from subprocess import check_output
103-
anon_sid = check_output([anon_sid_cmd, sid]).strip()
104-
lgr.info("Anonymized sid %s into %s", sid, anon_sid)
105-
return anon_sid
106-
return
101+
from subprocess import check_output
102+
cmd = [anon_sid_cmd, sid]
103+
return check_output(cmd).strip()
107104

108105

109106
def create_file_if_missing(filename, content):

0 commit comments

Comments
 (0)