python module: fix extensions without explicit subdir being installed to libdir

They are documented to go in site-packages, and indeed belong there.

Regression from the initial implementation via commit ad296976f0

Fixes #6331
pull/9134/head
Eli Schwartz 4 years ago
parent 44e123dd90
commit b0ffb80ecf
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 8
      mesonbuild/modules/python.py

@ -409,10 +409,10 @@ class PythonInstallation(ExternalProgramHolder):
@permittedKwargs(mod_kwargs)
def extension_module_method(self, args: T.List['TYPE_var'], kwargs: 'TYPE_kwargs') -> 'SharedModule':
if 'subdir' in kwargs and 'install_dir' in kwargs:
raise InvalidArguments('"subdir" and "install_dir" are mutually exclusive')
if 'subdir' in kwargs:
if 'install_dir' in kwargs:
if 'subdir' in kwargs:
raise InvalidArguments('"subdir" and "install_dir" are mutually exclusive')
else:
subdir = kwargs.pop('subdir', '')
if not isinstance(subdir, str):
raise InvalidArguments('"subdir" argument must be a string.')

Loading…
Cancel
Save