Skip to content

Commit 632082c

Browse files
committed
python: use missing
1 parent ca65b71 commit 632082c

5 files changed

Lines changed: 6 additions & 5 deletions

File tree

+stdlib/has_python.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
return
3333
end
3434

35-
y = ~isempty(stdlib.python_version());
35+
v = stdlib.python_version();
36+
y = ~ismissing(v) && ~isempty(v);
3637

3738
py_enable = y;
39+
3840
end

+stdlib/private/pvt_python_version.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function v = pvt_python_version()
22

3-
v = [];
3+
v = missing;
44

55
pe = pyenv();
66
% e.g. bad lexical cast: source type value could not be interpreted as target

+stdlib/python_home.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
pe = pyenv();
77
h = pe.Home;
88
catch
9-
h = string.empty;
9+
h = missing;
1010
end
1111

1212
end

+stdlib/python_version.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
persistent stdlib_py_version pyv_cached
2020

21-
msg = '';
21+
msg = missing;
2222

2323
if isempty(pyv_cached)
2424
pyv_cached = false;

test/TestLang.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ function test_python_home(tc)
1414
tc.assumeTrue(stdlib.has_python(), 'Python not available')
1515

1616
r = stdlib.python_home();
17-
tc.verifyNotEmpty(r)
1817
tc.verifyClass(r, 'string')
1918
end
2019

0 commit comments

Comments
 (0)