]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/tools/build/test/tree.py
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / tools / build / test / tree.py
index 70c66a3dbb4130072388b03f76821793b085a5e0..11899dd70ab1f385bf751eecfc3afc4d68b5eb7d 100644 (file)
@@ -20,6 +20,8 @@
 #
 ###############################################################################
 
+from __future__ import print_function
+
 import os
 import os.path
 import stat
@@ -100,10 +102,10 @@ class TreeDifference:
     def ignore_directories(self):
         """Removes directories from our lists of found differences."""
         not_dir = lambda x : x[-1] != "/"
-        self.added_files = filter(not_dir, self.added_files)
-        self.removed_files = filter(not_dir, self.removed_files)
-        self.modified_files = filter(not_dir, self.modified_files)
-        self.touched_files = filter(not_dir, self.touched_files)
+        self.added_files = list(filter(not_dir, self.added_files))
+        self.removed_files = list(filter(not_dir, self.removed_files))
+        self.modified_files = list(filter(not_dir, self.modified_files))
+        self.touched_files = list(filter(not_dir, self.touched_files))
 
     def pprint(self, file=sys.stdout):
         file.write("Added files   : %s\n" % self.added_files)
@@ -199,7 +201,7 @@ def _traverse_tree(t, parent_path):
 
 def _get_text(path):
     """Return a string with the textual contents of a file at PATH."""
-    fp = open(path, 'r')
+    fp = open(path, 'rb')
     try:
         return fp.read()
     finally: