Skip to content

Commit

Permalink
build: Ensure python3
Browse files Browse the repository at this point in the history
Bail out when python2 is detected.
  • Loading branch information
jp7677 committed Sep 4, 2021
1 parent 6f021c0 commit 5d7a17b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 5 additions & 1 deletion validate-methods.py
Original file line number Diff line number Diff line change
@@ -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 = []
Expand Down

0 comments on commit 5d7a17b

Please sign in to comment.