Skip to content

Commit

Permalink
test: skip if os.unshare is not available
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bluca authored and jrybar-rh committed Aug 26, 2024
1 parent f0b6735 commit a45a2a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("Python 3.12 is required for os.unshare(), skipping")
sys.exit(77)

if __name__ == "__main__":
parser = argparse.ArgumentParser()
Expand Down

0 comments on commit a45a2a1

Please sign in to comment.