modules/python: Add path method
This would normally be exposed by the ExternalProgramHolder, but wasn't
due to the implementation of the PythonInstallation module. Because of
that I've duplicated the method so that we can add the FeatureNew
decorator.
Fixes
@@ -311,11 +311,9 @@ class PythonInstallation(ExternalProgramHolder):
'get_path': self.get_path_method,
'has_variable': self.has_variable_method,
'get_variable': self.get_variable_method,
+ 'path': self.path_method,
})
- # Remove this so that an API change is not part of a refactor
- del self.methods['path_method']
-
@permittedKwargs(mod_kwargs)
def extension_module_method(self, args, kwargs):
if 'subdir' in kwargs and 'install_dir' in kwargs:
@@ -452,6 +450,12 @@ class PythonInstallation(ExternalProgramHolder):
return self.interpreter.module_method_callback(ModuleReturnValue(var, []))
+ @noPosargs
+ @noKwargs
+ @FeatureNew('Python module path method', '0.50.0')
+ def path_method(self, args, kwargs):
+ return super().path_method(args, kwargs)
+
class PythonModule(ExtensionModule):
