diff --git a/988630fae0.patch b/988630fae0.patch new file mode 100644 index 0000000..8a2c623 --- /dev/null +++ b/988630fae0.patch @@ -0,0 +1,22 @@ +From 988630fae0de7e561b60e62a41a6fff8aa6b4fbf Mon Sep 17 00:00:00 2001 +From: Rick van Hattem +Date: Thu, 3 Feb 2022 13:47:04 +0100 +Subject: [PATCH] Fixed Python 3.11 compatibility. Fixes #188 + +--- + stl/main.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/stl/main.py b/stl/main.py +index aa15390..60db581 100644 +--- a/stl/main.py ++++ b/stl/main.py +@@ -29,7 +29,7 @@ def _get_name(args): + args.name, + getattr(args.outfile, 'name', None), + getattr(args.infile, 'name', None), +- 'numpy-stl-%06d' % random.randint(0, 1e6), ++ 'numpy-stl-%06d' % random.randint(0, 1_000_000), + ] + + for name in names: # pragma: no branch diff --git a/python-numpy-stl.spec b/python-numpy-stl.spec index 1dfe156..07dfb0e 100644 --- a/python-numpy-stl.spec +++ b/python-numpy-stl.spec @@ -8,6 +8,10 @@ Summary: Library for reading, writing and modifying STL files License: BSD URL: https://github.com/WoLpH/numpy-stl/ Source: %{pypi_source} + +# Fix Python 3.11 compatibility wrt random.randint() +Patch: https://github.com/WoLpH/numpy-stl/commit/988630fae0.patch + BuildRequires: gcc BuildRequires: python3-devel