예제 #1
0
def check_python_3():
    """Ensures that the environment is good for unicode on Python 3."""
    try:
        from click import _unicodefun
        _unicodefun._verify_python3_env()
    except (TypeError, RuntimeError) as e:
        import sys
        import click
        click.echo(py3_err_msg, err=True)
        sys.exit(1)
예제 #2
0
def check_python_3():
    """Ensures that the environment is good for unicode on Python 3."""
    # https://github.com/pallets/click/issues/448#issuecomment-246029304
    import click.core
    click.core._verify_python3_env = lambda: None

    try:
        from click import _unicodefun
        _unicodefun._verify_python3_env()
    except (TypeError, RuntimeError) as e:
        import click
        click.echo(py3_err_msg, err=True)
예제 #3
0
def check_python_3():
    """Ensures that the environment is good for unicode on Python 3."""
    try:
        from click import _unicodefun

        _unicodefun._verify_python3_env()
    except (TypeError, RuntimeError) as e:
        import sys
        import click

        click.echo(py3_err_msg, err=True)
        sys.exit(1)
예제 #4
0
파일: cli.py 프로젝트: Rootopia/conda-pack
def main():
    # Pre-check for python3 unicode settings
    try:
        from click import _unicodefun
        _unicodefun._verify_python3_env()
    except (TypeError, RuntimeError) as e:
        click.echo(_py3_err_msg, err=True)

    # run main
    try:
        cli()
    except CondaPackException as e:
        click.echo("CondaPackError: %s" % e, err=True)
        sys.exit(1)
    except Exception as e:
        click.echo(traceback.format_exc(), err=True)
        sys.exit(1)
예제 #5
0
def check_python_3():
    """Ensures that the environment is good for unicode on Python 3."""
    # https://github.com/pallets/click/issues/448#issuecomment-246029304
    import click.core

    # TODO: Remove use of internal click functions
    if CLICK_VERSION < parse_version("8.0.0"):
        click.core._verify_python3_env = lambda: None
    else:
        click.core._verify_python_env = lambda: None

    try:
        from click import _unicodefun

        if CLICK_VERSION < parse_version("8.0.0"):
            _unicodefun._verify_python3_env()
        else:
            _unicodefun._verify_python_env()
    except (TypeError, RuntimeError):
        import click

        click.echo(py3_err_msg, err=True)