Skip to content

Commit

Permalink
Minor refactoring in get_python_version
Browse files Browse the repository at this point in the history
  • Loading branch information
ymyzk committed Dec 30, 2020
1 parent 9fd8296 commit 78264a3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/tox_gh_actions/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ def get_python_version():
- CPython => 2.7, 3.8, ...
- PyPy => pypy-2.7, pypy-3.7
"""
# Assuming running on CPython
version = ".".join([str(i) for i in sys.version_info[:2]])
if "PyPy" in sys.version:
version = "pypy-" + version
return version
version_prefix = "pypy-"
else:
# Assume this is running on CPython
version_prefix = ""
version = ".".join([str(i) for i in sys.version_info[:2]])
return version_prefix + version


def is_running_on_actions():
Expand Down

0 comments on commit 78264a3

Please sign in to comment.