]> git.sur5r.net Git - u-boot/commitdiff
moveconfig: Use fd.write() instead of print >>
authorSimon Glass <sjg@chromium.org>
Sun, 13 Aug 2017 22:02:54 +0000 (16:02 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 12 Sep 2017 03:43:58 +0000 (21:43 -0600)
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 <judge.packham@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
lib/libfdt/pylibfdt/libfdt.i
tools/moveconfig.py

index 3b11bb0c95111f365a1314658743fdc4c62cc486..146f4b942aabd73edbc1503cb2f1dbab3f10b548 100644 (file)
@@ -8,6 +8,8 @@
 
 %module libfdt
 
+%include <stdint.i>
+
 %{
 #define SWIG_FILE_WITH_INIT
 #include "libfdt.h"
index 8a038501929c0fa61ebb0da3a04d5c666b87b5a1..6f549a51c16d0c2d81c3effbd8f62f8d255f45a5 100755 (executable)
@@ -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()