fix for rare case when a file path points to a directory
This commit is contained in:
@@ -333,7 +333,8 @@ def pack(
|
|||||||
for src, dst in path_copy_files:
|
for src, dst in path_copy_files:
|
||||||
assert(b'.blend' not in dst)
|
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))
|
yield report(" %s: %r\n" % (colorize("source missing", color='red'), src))
|
||||||
else:
|
else:
|
||||||
yield report(" %s: %r -> %r\n" % (colorize("copying", color='blue'), src, dst))
|
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:
|
for src, dst in path_copy_files:
|
||||||
assert(not dst.endswith(b'.blend'))
|
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))
|
yield report(" %s: %r\n" % (colorize("source missing", color='red'), src))
|
||||||
else:
|
else:
|
||||||
yield report(" %s: %r -> <archive>\n" % (colorize("copying", color='blue'), src))
|
yield report(" %s: %r -> <archive>\n" % (colorize("copying", color='blue'), src))
|
||||||
|
Reference in New Issue
Block a user