# operands are the name of the variable and a Value node containing the
# value of the variable.
def build_config_file(target, source, env):
- (variable, value) = [s.get_contents() for s in source]
- f = file(str(target[0]), 'w')
- print('#define', variable, value, file=f)
- f.close()
+ (variable, value) = [s.get_contents().decode('utf-8') for s in source]
+ with open(str(target[0]), 'w') as f:
+ print('#define', variable, value, file=f)
return None
# Combine the two functions into a scons Action object.