Skip to content

Commit 4145a48

Browse files
authored
Enhance samepath function with existence check
Add check for path existence before comparing.
1 parent 64f966e commit 4145a48

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

+stdlib/+python/samepath.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
function y = samepath(path1, path2)
22

3+
if ~stdlib.exists(path1) || ~stdlib.exists(path2)
4+
y = false;
5+
return
6+
end
7+
38
try
49
y = py.os.path.samefile(path1, path2);
510
catch e

0 commit comments

Comments
 (0)