Skip to content

Commit 39cd334

Browse files
committed
has_python: simplify
1 parent 3aaf981 commit 39cd334

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

+stdlib/has_python.m

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,11 @@
44

55
function y = has_python()
66

7-
if isMATLABReleaseOlderThan('R2022b')
8-
% Matlab this old doesn't work as nice with Python
9-
% also, R2022b was the first to support Python 3.10
10-
y = false;
11-
return
12-
end
13-
147
try
158
pe = pyenv();
16-
catch e
17-
switch e.identifier
18-
case {'Octave:undefined-function', 'MATLAB:Python:PythonUnavailable'}
19-
y = false;
20-
return
21-
otherwise
22-
rethrow(e);
23-
end
9+
y = ~isempty(pe.Version);
10+
catch
11+
y = false;
2412
end
2513

26-
y = ~isempty(pe.Version);
27-
2814
end

0 commit comments

Comments
 (0)