Skip to content

Commit 0f79b9f

Browse files
committed
Ignore directories for multiple morphs
1 parent 8ebb960 commit 0f79b9f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/diffpy/pdfmorph/pdfmorphapp.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,13 @@ def multiple_morphs(parser, opts, pargs, stdout_flag=True):
475475
if not target_directory.is_dir():
476476
parser.custom_error(f"{target_directory} is not a directory. Go to --help for usage.")
477477

478-
# Do not morph morph_file against itself if it is in the same directory
478+
# Get list of files from target directory
479479
target_list = list(target_directory.iterdir())
480+
for target in target_list:
481+
if target.is_dir():
482+
target_list.remove(target)
483+
484+
# Do not morph morph_file against itself if it is in the same directory
480485
if morph_file in target_list:
481486
target_list.remove(morph_file)
482487

0 commit comments

Comments
 (0)