Add repr() for EnvironmentVariables{,Holder}

Makes it easier to debug issues with it
pull/1402/head
Nirbheek Chauhan 8 years ago
parent e9f9a42c7a
commit f1fe823763
  1. 4
      mesonbuild/build.py
  2. 4
      mesonbuild/interpreter.py

@ -227,6 +227,10 @@ class EnvironmentVariables:
def __init__(self): def __init__(self):
self.envvars = [] self.envvars = []
def __repr__(self):
repr_str = "<{0}: {1}>"
return repr_str.format(self.__class__.__name__, self.envvars)
def get_value(self, name, values, kwargs): def get_value(self, name, values, kwargs):
separator = kwargs.get('separator', os.pathsep) separator = kwargs.get('separator', os.pathsep)

@ -134,6 +134,10 @@ class EnvironmentVariablesHolder(MutableInterpreterObject):
'prepend': self.prepend_method, 'prepend': self.prepend_method,
}) })
def __repr__(self):
repr_str = "<{0}: {1}>"
return repr_str.format(self.__class__.__name__, self.held_object.envvars)
@stringArgs @stringArgs
def add_var(self, method, args, kwargs): def add_var(self, method, args, kwargs):
if not isinstance(kwargs.get("separator", ""), str): if not isinstance(kwargs.get("separator", ""), str):

Loading…
Cancel
Save