Whitespace fix to test new Docker setup.

pull/574/head
Jussi Pakkanen 9 years ago
parent 4377f773e0
commit 28b555d2c8
  1. 3
      .travis.yml
  2. 32
      mesonbuild/interpreter.py

@ -9,4 +9,5 @@ before_install:
- docker pull jpakkane/mesonci:xenial
script:
- docker run jpakkane/mesonci:xenial /bin/sh -c "cd /root && git clone https://github.com/mesonbuild/meson.git && cd meson && ./run_tests.py"
- docker cp /home/travis/mesonbuild/meson jpakkane/mesonci:xenial:/root
- docker run jpakkane/mesonci:xenial /bin/sh -c "cd /root/meson && ./run_tests.py"

@ -2096,23 +2096,23 @@ class Interpreter():
obj = self.to_native(obj)
(posargs, _) = self.reduce_arguments(args)
if method_name == 'to_string':
if len(posargs) == 0:
if obj == True:
return 'true'
else:
return 'false'
elif len(posargs) == 2 and isinstance(posargs[0], str) and isinstance(posargs[1], str):
if obj == True:
return posargs[0]
else:
return posargs[1]
else:
raise InterpreterException('bool.to_string() must have either no arguments or exactly two string arguments.')
if len(posargs) == 0:
if obj == True:
return 'true'
else:
return 'false'
elif len(posargs) == 2 and isinstance(posargs[0], str) and isinstance(posargs[1], str):
if obj == True:
return posargs[0]
else:
return posargs[1]
else:
raise InterpreterException('bool.to_string() must have either no arguments or exactly two string arguments.')
elif method_name == 'to_int':
if obj == True:
return 1
else:
return 0
if obj == True:
return 1
else:
return 0
else:
raise InterpreterException('Unknown method "%s" for a boolean.' % method_name)

Loading…
Cancel
Save