コード例 #1
0
ファイル: utils.py プロジェクト: hal2001/distributed
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
ファイル: utils.py プロジェクト: zbitouzakaria/distributed
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
ファイル: utils.py プロジェクト: broxtronix/distributed
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
ファイル: utils.py プロジェクト: jacobtomlinson/distributed
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)