INNER CODE UNIT · Python

__init__

devstream-io/devstream · devstream/env_manager.py:40

    def __init__(self):
        pass

    @staticmethod
    def get_py_version(py: str) -> Optional[str]:
        """
        Get the version of the python executable.
        """
        py_version_cmd = [py, "--version"]
        with subprocess.Popen(py_version_cmd, stdout=subprocess.PIPE, stderr=None) as proc:
            proc.wait()

            if proc.returncode != 0:
                return None

            out = proc.stdout.read().decode("utf-8")
            return out.split()[1]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…