diff --git a/bam/blend/blendfile_pack.py b/bam/blend/blendfile_pack.py index b611637..5e8d18e 100755 --- a/bam/blend/blendfile_pack.py +++ b/bam/blend/blendfile_pack.py @@ -333,7 +333,8 @@ def pack( for src, dst in path_copy_files: assert(b'.blend' not in dst) - if not os.path.exists(src): + # in rare cases a filepath could point to a directory + if (not os.path.exists(src)) or os.path.isdir(src): yield report(" %s: %r\n" % (colorize("source missing", color='red'), src)) else: yield report(" %s: %r -> %r\n" % (colorize("copying", color='blue'), src, dst)) @@ -369,7 +370,8 @@ def pack( for src, dst in path_copy_files: assert(not dst.endswith(b'.blend')) - if not os.path.exists(src): + # in rare cases a filepath could point to a directory + if (not os.path.exists(src)) or os.path.isdir(src): yield report(" %s: %r\n" % (colorize("source missing", color='red'), src)) else: yield report(" %s: %r -> \n" % (colorize("copying", color='blue'), src))