Skip to content

Commit 2b910c0

Browse files
committed
add no_matlab message; make sure found_vers is nonempty; XLSA->XSLA
1 parent 0ee25f3 commit 2b910c0

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class _MatlabFinder(build_py):
6060
set_path = "MATLAB installation not found in {path1:s}. Add matlabroot/bin/{arch:s} to {path2:s}."
6161
no_compatible_matlab = "No compatible MATLAB installation found in Windows Registry. This release of " + \
6262
"MATLAB Engine API for Python is compatible with version {ver:s}. The found versions were"
63+
no_matlab = "No MATLAB installation found in Windows Registry."
6364
incompatible_ver = "MATLAB version {ver:s} was found, but MATLAB Engine API for Python is not compatible with it. " + \
6465
"To install a compatible version, call python -m pip install matlabengine=={found:s}."
6566

@@ -175,8 +176,11 @@ def _find_matlab_key_from_windows_registry(self, key):
175176
break
176177

177178
if not key_value:
178-
vers = ', '.join(found_vers)
179-
raise RuntimeError(f"{self.no_compatible_matlab.format(ver=self.MATLAB_VER)} {vers}. {self.install_compatible}{vers[-1]}.")
179+
if found_vers:
180+
vers = ', '.join(found_vers)
181+
raise RuntimeError(f"{self.no_compatible_matlab.format(ver=self.MATLAB_VER)} {vers}. {self.install_compatible}{found_vers[-1]}.")
182+
else:
183+
raise RuntimeError(f"{self.no_matlab}")
180184

181185
return key_value
182186

@@ -283,7 +287,7 @@ def run(self):
283287
version="9.12",
284288
description='A module to call MATLAB from Python',
285289
author='MathWorks',
286-
license="MathWorks XLSA License",
290+
license="MathWorks XSLA License",
287291
url='https://github.com/mathworks/matlab-engine-for-python/',
288292
long_description=long_description,
289293
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)