提交 c79d18c4 编写于 作者: S Simon Glass

moveconfig: Use fd.write() instead of print >>

Adjust this code so that it can work with Python 2 and 3.

Fixes: d73fcb12 (moveconfig: Support building a simple config database)
Reported-by: NChris Packham <judge.packham@gmail.com>
Signed-off-by: NSimon Glass <sjg@chromium.org>
上级 3991f42e
......@@ -8,6 +8,8 @@
%module libfdt
%include <stdint.i>
%{
#define SWIG_FILE_WITH_INIT
#include "libfdt.h"
......
......@@ -1877,10 +1877,10 @@ def main():
if options.build_db:
with open(CONFIG_DATABASE, 'w') as fd:
for defconfig, configs in config_db.iteritems():
print >>fd, '%s' % defconfig
fd.write('%s\n' % defconfig)
for config in sorted(configs.keys()):
print >>fd, ' %s=%s' % (config, configs[config])
print >>fd
fd.write(' %s=%s\n' % (config, configs[config]))
fd.write('\n')
if __name__ == '__main__':
main()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册