From: Simon Glass Date: Sun, 13 Aug 2017 22:02:54 +0000 (-0600) Subject: moveconfig: Use fd.write() instead of print >> X-Git-Tag: v2017.11-rc1~167^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c79d18c4b40d10c0a95b56e51f4517aca4515364;p=u-boot 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 Signed-off-by: Simon Glass --- diff --git a/lib/libfdt/pylibfdt/libfdt.i b/lib/libfdt/pylibfdt/libfdt.i index 3b11bb0c95..146f4b942a 100644 --- a/lib/libfdt/pylibfdt/libfdt.i +++ b/lib/libfdt/pylibfdt/libfdt.i @@ -8,6 +8,8 @@ %module libfdt +%include + %{ #define SWIG_FILE_WITH_INIT #include "libfdt.h" diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 8a03850192..6f549a51c1 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -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()