Don't expose module functions prefixed with _

This is the common Python convention for private methods
so lets not expose these to build files as they are
implementation details and their behavior is undefined.
pull/942/head
Patrick Griffis 9 years ago
parent d37bbef411
commit 1811f83e2a
  1. 2
      mesonbuild/interpreter.py

@ -981,6 +981,8 @@ class ModuleHolder(InterpreterObject):
fn = getattr(self.held_object, method_name)
except AttributeError:
raise InvalidArguments('Module %s does not have method %s.' % (self.modname, method_name))
if method_name.startswith('_'):
raise InvalidArguments('Function {!r} in module {!r} is private.'.format(method_name, self.modname))
state = ModuleState()
state.build_to_src = os.path.relpath(self.interpreter.environment.get_source_dir(),
self.interpreter.environment.get_build_dir())

Loading…
Cancel
Save