38 lines
1.3 KiB
Diff
38 lines
1.3 KiB
Diff
From 6a6f22d6e99c973bf2f9f400d52370107ae9396b Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?H=C3=A5vard?= <havard.f.aasen@pfft.no>
|
|
Date: Thu, 26 May 2022 21:26:55 +0000
|
|
Subject: [PATCH] Make Python test script compatible with Python 2 and Python
|
|
3. (#35)
|
|
|
|
The shebang line is still restricting it to Python 2.
|
|
Removed end-of-line whitespace as well.
|
|
---
|
|
bindings/python/test/capng-test.py | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/bindings/python/test/capng-test.py b/bindings/python/test/capng-test.py
|
|
index 6688e77..e6350ec 100755
|
|
--- a/bindings/python/test/capng-test.py
|
|
+++ b/bindings/python/test/capng-test.py
|
|
@@ -14,7 +14,7 @@ try:
|
|
with open('/proc/sys/kernel/cap_last_cap', 'r') as f:
|
|
last = int(f.readline())
|
|
except IOError as e:
|
|
- print "Error opening /proc/sys/kernel/cap_last_cap: {0}".format(e.strerror)
|
|
+ print("Error opening /proc/sys/kernel/cap_last_cap: {0}".format(e.strerror))
|
|
|
|
print("Doing basic bit tests...")
|
|
capng.capng_clear(capng.CAPNG_SELECT_BOTH)
|
|
@@ -49,7 +49,7 @@ for i in range(last+1):
|
|
if capng.capng_have_capabilities(capng.CAPNG_SELECT_CAPS) != capng.CAPNG_PARTIAL:
|
|
print("Failed have capabilities test 1")
|
|
sys.exit(1)
|
|
-
|
|
+
|
|
capng.capng_fill(capng.CAPNG_SELECT_BOTH)
|
|
rc = capng.capng_update(capng.CAPNG_DROP, capng.CAPNG_EFFECTIVE, i)
|
|
if rc:
|
|
--
|
|
2.27.0
|
|
|