Skip to content

Commit

Permalink
modules/python3: exclude name_prefix and name_suffix
Browse files Browse the repository at this point in the history
We can remove these from `permittedKwargs` (like we've already done for
`typed_kwargs`) and then remove the in body checks.
  • Loading branch information
dcbaker authored and eli-schwartz committed Jul 28, 2023
1 parent 10a94d3 commit d9870ed
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions mesonbuild/modules/python3.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,10 @@ def __init__(self, *args, **kwargs):
'sysconfig_path': self.sysconfig_path,
})

@permittedKwargs(known_shmod_kwargs)
@permittedKwargs(known_shmod_kwargs - {'name_prefix', 'name_suffix'})
@typed_pos_args('python3.extension_module', str, varargs=(str, mesonlib.File, CustomTarget, CustomTargetIndex, GeneratedList, StructuredSources, ExtractedObjects, BuildTarget))
@typed_kwargs('python3.extension_module', *_MOD_KWARGS, allow_unknown=True)
def extension_module(self, state: ModuleState, args: T.Tuple[str, T.List[BuildTargetSource]], kwargs: SharedModuleKW):
if 'name_prefix' in kwargs:
raise mesonlib.MesonException('Name_prefix is set automatically, specifying it is forbidden.')
if 'name_suffix' in kwargs:
raise mesonlib.MesonException('Name_suffix is set automatically, specifying it is forbidden.')
host_system = state.host_machine.system
if host_system == 'darwin':
# Default suffix is 'dylib' but Python does not use it for extensions.
Expand Down

0 comments on commit d9870ed

Please sign in to comment.