From 42ac8d6dc4c999a0a9b5347f20159a6732cec253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 21 Apr 2015 13:46:49 +0200 Subject: [PATCH] libselinux: selinux.py - use os.walk() instead of os.path.walk() os.path.walk() function is deprecated and has been removed in Python 3 Signed-off-by: Petr Lautrbach Acked-by: Steve Lawrence --- libselinux/src/selinuxswig_python.i | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libselinux/src/selinuxswig_python.i b/libselinux/src/selinuxswig_python.i index ae72246f..c9a2341a 100644 --- a/libselinux/src/selinuxswig_python.i +++ b/libselinux/src/selinuxswig_python.i @@ -31,9 +31,9 @@ def restorecon(path, recursive=False): lsetfilecon(path, context) if recursive: - os.path.walk(path, lambda arg, dirname, fnames: - map(restorecon, [os.path.join(dirname, fname) - for fname in fnames]), None) + for root, dirs, files in os.walk(path): + for name in files + dirs: + restorecon(os.path.join(root, name)) def chcon(path, context, recursive=False): """ Set the SELinux context on a given path """