def travis_env_to_tox_env(travis_env):
    """Converts a Travis-style environment (e.g.: "2.6") to a Tox-style
    environment (e.g.: "py26")."""

    travis_env = str(travis_env)

    if not travis_env.startswith('py') and travis_env[1] == '.':
        return 'py' + travis_env.replace('.', '')
    else:
        return travis_env