moveconfig: Use fd.write() instead of print >>
PATCH 1/1 moveconfig: Use fd.write() instead of print >>
Adjust this code so that it can work with Python 2 and 3.
Fixes d73fcb1 (moveconfig: Support building a simple config database)
Reported-by Chris Packham <[email protected]>
Signed-off-by Simon Glass <[email protected]>
---
lib/libfdt/pylibfdt/libfdt.i | 2 ++ tools/moveconfig.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-)
lib/libfdt/pylibfdt/libfdt.i +2 -0
@@ -8,6 +8,8 @@ %module libfdt +%include <stdint.i> + %{ #define SWIG_FILE_WITH_INIT #include "libfdt.h"
tools/moveconfig.py +3 -3
@@ -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()
Signature · 1 line
2.14.0.434.g98096fd7a8-goog
PATCH 1/1 moveconfig: Use fd.write() instead of print >>
Adjust this code so that it can work with Python 2 and 3.
Fixes d73fcb1 (moveconfig: Support building a simple config database)
Reported-by Chris Packham <[email protected]>
Signed-off-by Simon Glass <[email protected]>
---
lib/libfdt/pylibfdt/libfdt.i | 2 ++ tools/moveconfig.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-)
Applied to u-boot-dm, thanks!