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
Fixes
@@ -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 '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.')
