Skip to content

Commit f0ed83a

Browse files
committed
use stdlib.has_python for uniformity/clarity
this also avoids a case where Python is only partially working. This happens if an incompatible or broken Python version is specified to pyenv(Version=)
1 parent 4b6d545 commit f0ed83a

25 files changed

+75
-50
lines changed

+stdlib/cpu_load.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
case 'java'
2525
i = stdlib.java.cpu_load();
2626
case 'python'
27-
if stdlib.matlabOlderThan('R2022a'), continue, end
28-
i = stdlib.python.cpu_load();
27+
if stdlib.has_python()
28+
i = stdlib.python.cpu_load();
29+
end
2930
case 'sys'
3031
i = stdlib.sys.cpu_load();
3132
otherwise

+stdlib/create_symlink.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
case 'dotnet'
2525
i = stdlib.dotnet.create_symlink(target, link);
2626
case 'python'
27-
if stdlib.matlabOlderThan('R2022a'), continue, end
28-
i = stdlib.python.create_symlink(target, link);
27+
if stdlib.has_python()
28+
i = stdlib.python.create_symlink(target, link);
29+
end
2930
case 'sys'
3031
i = stdlib.sys.create_symlink(target, link);
3132
otherwise

+stdlib/device.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
case 'java'
2323
i = stdlib.java.device(file);
2424
case 'python'
25-
if stdlib.matlabOlderThan('R2022a'), continue, end
26-
i = stdlib.python.device(file);
25+
if stdlib.has_python()
26+
i = stdlib.python.device(file);
27+
end
2728
case 'sys'
2829
i = stdlib.sys.device(file);
2930
otherwise

+stdlib/disk_available.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
case 'java'
2828
i = stdlib.java.disk_available(file);
2929
case 'python'
30-
if stdlib.matlabOlderThan('R2022a'), continue, end
31-
i = stdlib.python.disk_available(file);
30+
if stdlib.has_python()
31+
i = stdlib.python.disk_available(file);
32+
end
3233
case 'sys'
3334
i = stdlib.sys.disk_available(file);
3435
otherwise

+stdlib/disk_capacity.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525
case 'java'
2626
i = stdlib.java.disk_capacity(file);
2727
case 'python'
28-
if stdlib.matlabOlderThan('R2022a'), continue, end
29-
i = stdlib.python.disk_capacity(file);
28+
if stdlib.has_python()
29+
i = stdlib.python.disk_capacity(file);
30+
end
3031
case 'sys'
3132
i = stdlib.sys.disk_capacity(file);
3233
otherwise

+stdlib/filesystem_type.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
case 'dotnet'
2727
r = stdlib.dotnet.filesystem_type(file);
2828
case 'python'
29-
if stdlib.matlabOlderThan('R2022a'), continue, end
30-
r = stdlib.python.filesystem_type(file);
29+
if stdlib.has_python()
30+
r = stdlib.python.filesystem_type(file);
31+
end
3132
case 'sys'
3233
r = stdlib.sys.filesystem_type(file);
3334
otherwise

+stdlib/get_owner.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
case 'dotnet'
2525
r = stdlib.dotnet.get_owner(file);
2626
case 'python'
27-
if stdlib.matlabOlderThan('R2022a'), continue, end
28-
r = stdlib.python.get_owner(file);
27+
if stdlib.has_python()
28+
r = stdlib.python.get_owner(file);
29+
end
2930
case 'sys'
3031
r = stdlib.sys.get_owner(file);
3132
otherwise

+stdlib/get_process_priority.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
case 'dotnet'
2525
i = stdlib.dotnet.get_process_priority();
2626
case 'python'
27-
if stdlib.matlabOlderThan('R2022a'), continue, end
28-
i = stdlib.python.get_process_priority();
27+
if stdlib.has_python()
28+
i = stdlib.python.get_process_priority();
29+
end
2930
case 'sys'
3031
i = stdlib.sys.get_process_priority();
3132
otherwise

+stdlib/get_uid.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
case 'dotnet'
2222
i = stdlib.dotnet.get_uid();
2323
case 'python'
24-
if stdlib.matlabOlderThan('R2022a'), continue, end
25-
i = stdlib.python.get_uid();
24+
if stdlib.has_python()
25+
i = stdlib.python.get_uid();
26+
end
2627
case 'perl'
2728
i = stdlib.perl.get_uid();
2829
otherwise

+stdlib/get_username.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
case 'dotnet'
2424
r = stdlib.dotnet.get_username();
2525
case 'python'
26-
if stdlib.matlabOlderThan('R2022a'), continue, end
27-
r = stdlib.python.get_username();
26+
if stdlib.has_python()
27+
r = stdlib.python.get_username();
28+
end
2829
case 'sys'
2930
r = stdlib.sys.get_username();
3031
otherwise

0 commit comments

Comments
 (0)