1 | ## @file
|
---|
2 | # Test whether PYTHON_COMMAND is available and the
|
---|
3 | # minimum Python version is installed.
|
---|
4 | #
|
---|
5 | # Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
---|
6 | # SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
7 | #
|
---|
8 |
|
---|
9 | import sys
|
---|
10 |
|
---|
11 | if __name__ == '__main__':
|
---|
12 | # Check if the major and minor versions required were specified.
|
---|
13 | if len(sys.argv) >= 3:
|
---|
14 | req_major_version = int(sys.argv[1])
|
---|
15 | req_minor_version = int(sys.argv[2])
|
---|
16 | else:
|
---|
17 | # If the minimum version wasn't specified on the command line,
|
---|
18 | # default to 3.6 because BaseTools uses syntax from PEP 526
|
---|
19 | # (https://peps.python.org/pep-0526/)
|
---|
20 | req_major_version = 3
|
---|
21 | req_minor_version = 6
|
---|
22 |
|
---|
23 | if sys.version_info.major == req_major_version and \
|
---|
24 | sys.version_info.minor >= req_minor_version:
|
---|
25 | sys.exit(0)
|
---|
26 | else:
|
---|
27 | sys.exit(1)
|
---|