Skip to content

Commit b01c62d

Browse files
bpoldrackmih
authored andcommitted
BF: Don't create a sourcedata-dir just for a README; Check lexists for the actual file instead
1 parent ce11874 commit b01c62d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

heudiconv/bids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def populate_bids_templates(path, defaults={}):
5151
('DatasetDOI', 'TODO: eventually a DOI for the dataset')
5252
]))
5353
sourcedata_README = op.join(path, 'sourcedata', 'README')
54-
if not op.lexists(op.dirname(sourcedata_README)):
54+
if op.exists(op.dirname(sourcedata_README)):
5555
create_file_if_missing(sourcedata_README,
5656
("TODO: Provide description about source data, e.g. \n"
5757
"Directory below contains DICOMS compressed into tarballs per "

heudiconv/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def anonymize_sid(sid, anon_sid_cmd):
110110
def create_file_if_missing(filename, content):
111111
"""Create file if missing, so we do not
112112
override any possibly introduced changes"""
113-
if op.exists(filename):
113+
if op.lexists(filename):
114114
return False
115115
dirname = op.dirname(filename)
116116
if not op.exists(dirname):

0 commit comments

Comments
 (0)