diff options
author | Jens Peters <jp7677@gmail.com> | 2021-09-04 17:27:42 +0300 |
---|---|---|
committer | Jens Peters <jp7677@gmail.com> | 2021-09-04 18:09:22 +0300 |
commit | a5e330b98e0c3d87b719fef435b81ba968415bb7 (patch) | |
tree | 1279494a64a3663881c7b07f3ecb32eef9eaa5cb | |
parent | 6f021c0c199419277d0c9d07e21ce12734357fc2 (diff) |
build: Ensure python3
Bail out when python2 is detected.
-rwxr-xr-x | package-release.sh | 2 | ||||
-rw-r--r-- | validate-methods.py | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/package-release.sh b/package-release.sh index 2a7d7a4..2c59e06 100755 --- a/package-release.sh +++ b/package-release.sh @@ -44,7 +44,7 @@ while [ $# -gt 0 ]; do done function prepare { - python validate-methods.py \ + python3 validate-methods.py \ src/nvapi.cpp \ src/nvapi_sys.cpp \ src/nvapi_disp.cpp \ diff --git a/validate-methods.py b/validate-methods.py index fd1e8dd..87c63df 100644 --- a/validate-methods.py +++ b/validate-methods.py @@ -1,7 +1,11 @@ import sys, re, getopt +if sys.version_info[0] < 3: + print("Method validation failed due to invalid Python interpreter. Please use Python 3 as your default Python interpreter.") + sys.exit(1) + if len(sys.argv) < 3: - print("Usage: python validate-methods.py <implementation1.cpp> [implementation2.cpp] <interface.cpp> <interface.h>") + print("Method validation failed due to invalid usage. Usage: python validate-methods.py <implementation1.cpp> [implementation2.cpp] <interface.cpp> <interface.h>") sys.exit(1) expectedMethods = [] @@ -36,11 +40,11 @@ with open(sys.argv[len(sys.argv) - 1]) as file: availableMethods.append(result.group(1)) if len(expectedMethods) != len(foundMethods) or len(set(expectedMethods).intersection(foundMethods)) != len(expectedMethods): - print("Method validation failed. Please make sure that all implemented NVAPI methods are also listed in the `nvapi_QueryInterface` method.") + print("Method validation failed. Please make sure that all implemented NVAPI methods are also listed in the `nvapi_QueryInterface` function.") sys.exit(1) if not set(foundMethods).issubset(set(availableMethods)): - print("Method validation failed. Please make sure that all implemented NVAPI methods correspond to available methods in the `nvapi_interface_table` header method.") + print("Method validation failed. Please make sure that all implemented NVAPI methods correspond to available methods in the `nvapi_interface_table` struct.") sys.exit(1) sys.exit(0) |