Projects
Mega:24.03
libcap-ng
_service:tar_scm:backport-Make-Python-test-scri...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-Make-Python-test-script-compatible-with-Python2-and-Python3.patch of Package libcap-ng
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
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2