From 0a826c458544a0b1a5906f3f4e5001a544fb2d00 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 8 Aug 2024 19:35:36 +0100 Subject: [PATCH] test: skip if os.unshare is not available It was added in Python 3.12 which is very recent, so skip gracefully if it is not available, like on the current Debian stable or Ubuntu Jammy https://docs.python.org/3/library/os.html#os.unshare --- test/wrapper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/wrapper.py b/test/wrapper.py index 4f24c1fe..bc1737fb 100755 --- a/test/wrapper.py +++ b/test/wrapper.py @@ -32,6 +32,9 @@ def setup_test_namespace(data_dir): except PermissionError: print("Lacking permissions to set up test harness, skipping") sys.exit(77) + except AttributeError: + print("Python3 3.12 is required for os.unshare(), skipping") + sys.exit(77) if __name__ == "__main__": parser = argparse.ArgumentParser()