Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
crossover / opt / cxoffice / lib / python / checkpython.py
Size: Mime:
# (c) Copyright 2013-2014. CodeWeavers, Inc.

"""
CrossOver is not compatible with Python 3 so try to find a more compatible
Python version to run it with.

See also checkgtk.py.
"""

import sys
if sys.version_info >= (3,):
    import os
    try:
        os.execvp('python2', ['python2'] + sys.argv)
    except:
        from cxutils import cxgettext as _
        # pylint: disable=C0325
        print(_("Could not find a suitable Python 2 interpreter. Will now try to install one."))

    # Getting the Python 2 GTK+ modules will automatically get us a suitable
    # Python 2 interpreter.
    import cxfixes
    cxfixes.add_error('gtk2')
    cxfixes.fix_errors()

    try:
        os.execvp('python2', ['python2'] + sys.argv)
    except:
        cxfixes.report_errors()
        sys.exit(1)