Skip to content

Commit fc02f7b

Browse files
committed
python: catch missing import
1 parent 5b1fe6b commit fc02f7b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

+stdlib/+python/private/pythonException.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
function pythonException(e)
22

33
switch e.identifier
4-
case 'MATLAB:Python:PythonUnavailable'
5-
% pass
4+
case {'MATLAB:Python:PythonUnavailable', 'MATLAB:undefinedVarOrClass'}
5+
% Python not available or Python imported module not available
66
case 'MATLAB:Python:PyException'
77
if ~contains(e.message, ["is not in the subpath of", "NotADirectoryError", "FileNotFoundError"])
88
rethrow(e)

test/TestBackend.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
% * Alternative: install a temporary Python environment, set pyenv to that, then delete that Python install
77

88
classdef (SharedTestFixtures={ matlab.unittest.fixtures.PathFixture(fileparts(fileparts(mfilename('fullpath'))))}, ...
9-
TestTags = {'impure'}) ...
9+
TestTags = {'R2019b', 'impure'}) ...
1010
TestBackend < matlab.unittest.TestCase
1111

1212
properties

0 commit comments

Comments
 (0)