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 18dff9d commit 00c1b4bCopy full SHA for 00c1b4b
+stdlib/python_version.m
@@ -12,13 +12,15 @@
12
% where the environment has changed since pyenv() was set. For example
13
% HPC with "module load python3..."
14
15
-function v = python_version(force_old)
+function [v, msg] = python_version(force_old)
16
if nargin < 1
17
force_old = false;
18
end
19
20
persistent stdlib_py_version
21
22
+msg = '';
23
+
24
if ~isempty(stdlib_py_version)
25
v = stdlib_py_version;
26
return
@@ -34,9 +36,11 @@
34
36
35
37
38
-% need to have no catch section as glitchy Python load can make TypeError etc.
-try %#ok<TRYNC>
39
+% glitchy Python load can error on sys.version_info
40
+try
41
v = pvt_python_version();
42
+catch e
43
+ msg = e.message;
44
45
46
% cache the result
0 commit comments