FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
setup-python/__tests__/verify-python.py at main · solveforceapp/setup-python · GitHub
solveforceapp
/
setup-python
Public
forked from
actions/setup-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
setup-python
/
__tests__
/
verify-python.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (20 loc) · 1000 Bytes
Breadcrumbs
setup-python
/
__tests__
/
verify-python.py
Copy path
File metadata and controls
22 lines (20 loc) · 1000 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import
sys
argCount
=
len
(
sys
.
argv
)
-
1
if
argCount
==
1
:
expectedVersion
=
sys
.
argv
[
1
]
versions
=
len
(
expectedVersion
.
split
(
"."
))
majorMinor
=
str
(
sys
.
version_info
[
0
])
+
'.'
+
str
(
sys
.
version_info
[
1
])
if
versions
==
2
:
# Test only major and minor version
if
expectedVersion
!=
majorMinor
:
raise
Exception
(
"Incorrect major + minor version detected
\n
Expected: "
+
expectedVersion
+
"
\n
Actual: "
+
majorMinor
)
elif
versions
==
3
:
# Test major, minor and micro version
majorMinorMicro
=
majorMinor
+
'.'
+
str
(
sys
.
version_info
[
2
])
if
expectedVersion
!=
majorMinorMicro
:
raise
Exception
(
"Incorrect major + minor + micro version detected
\n
Expected: "
+
expectedVersion
+
"
\n
Actual: "
+
majorMinorMicro
)
else
:
raise
Exception
(
"Incorrect number of arguments supplied"
)
print
(
"Correct version of Python "
+
expectedVersion
+
" detected"
)
else
:
raise
Exception
(
"Incorrect number of arguments supplied"
)
Back
|
FazBrowse Home
|
New Git URL