Skip to content

Commit 24c3726

Browse files
committed
has_python: allow user to disable persistently
1 parent a677739 commit 24c3726

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

+stdlib/has_python.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
% https://www.mathworks.com/support/requirements/python-compatibility.html
44

55
function y = has_python(enable_check)
6+
% arguments
7+
% enable_check (1,1) logical = ~stdlib.matlabOlderThan('R2022a');
8+
% end
9+
10+
persistent py_enable
11+
12+
if ~isempty(py_enable) && nargin == 0
13+
y = py_enable;
14+
return
15+
end
616

717
y = false;
818

@@ -14,6 +24,8 @@
1424
y = ~isempty(stdlib.python_version());
1525
end
1626

27+
py_enable = y;
28+
1729
end
1830

1931
%!assert(~stdlib.has_python())

0 commit comments

Comments
 (0)