We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a00baf6 commit 7c9dfbdCopy full SHA for 7c9dfbd
+stdlib/+python/version.m
+stdlib/+python/private/pvt_python_version.m renamed to +stdlib/private/pvt_python_version.m
+stdlib/python_version.m
@@ -24,10 +24,20 @@
24
return
25
end
26
27
-% we use a separate function because the JIT compiler in Matlab < R2022a
28
-% breaks for any py.* command when pyenv() is not correctly configured
+% Matlab < R2022a has a bug in the JIT compiler that breaks try-catch
+% for any py.* command.
29
+% We use a separate private function to workaround that.
30
-v = stdlib.python.version(force_old);
31
+v = [];
32
+
33
+if isMATLABReleaseOlderThan('R2022a') && ~force_old
34
+ return
35
+end
36
37
+% need to have no catch section as glitchy Python load can make TypeError etc.
38
+try %#ok<TRYNC>
39
+ v = pvt_python_version();
40
41
42
% cache the result
43
if ~isempty(v)
0 commit comments