ctdb/wscript: use python 3.6 compatible functions
authorStefan Metzmacher <metze@samba.org>
Mon, 19 Nov 2018 11:05:29 +0000 (12:05 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 5 Dec 2018 12:35:19 +0000 (13:35 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
ctdb/wscript

index baf660fadf61e06656020e46d79946a6d1b7ee8c..3f8081ec3e8ec780b59cb577e824d84bdb3fbda0 100644 (file)
@@ -340,7 +340,7 @@ def configure(conf):
                 Logs.info("  %s: no" % (m))
 
 def gen_ctdb_version(task):
-    fp = file(task.outputs[0].bldpath(task.env), 'w')
+    fp = open(task.outputs[0].bldpath(task.env), 'w')
     fp.write('/* This file is auto-generated from waf */\n')
     fp.write('#include "version.h"\n')
     fp.write('\n')
@@ -786,7 +786,8 @@ def build(bld):
 
     def SUBDIR_MODE(path, trim_path=None):
         pd = {'trim_path': trim_path, 'file_list': []}
-        os.path.walk(path, SUBDIR_MODE_callback, pd)
+        for dirname, _subdirs, fnames in os.walk(path):
+            SUBDIR_MODE_callback(pd, dirname, fnames)
         return pd['file_list']
 
     event_script_subdirs = [