Skip to content

Commit 10e544f

Browse files
committed
python.inode: correct type casting like python.device
Disregard older Matlab <= R2022a as they can use other methods, Python doesn't work as well with those old Matlab versions anyway.
1 parent 0f01d1d commit 10e544f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

+stdlib/+python/inode.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
function i = inode(file)
22

33
try
4-
i = int64(py.os.stat(file).st_ino);
5-
% int64 first is for Matlab <= R2022a
4+
i = py.os.stat(file).st_ino;
5+
% Matlab <= R2022a wants int64 before uint64, but this can make OverflowError on Windows within Python
6+
% because on Windows st_dev is a 64-bit unsigned integer
67
catch e
78
pythonException(e)
89
i = [];
910
end
1011

1112
i = uint64(i);
13+
1214
end

+stdlib/+python/private/disk_usage.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
case 'free', i = u.free;
88
otherwise, error('stdlib:python:disk_usage:valueError', 'unknown disk_usage property %s', v)
99
end
10-
11-
i = int64(i);
12-
% int64 first is for Matlab <= R2022a
1310
catch
1411
i = [];
1512
end

0 commit comments

Comments
 (0)