view tests/sitecustomize.py @ 31443:0241dd94ed38

exewrapper: prefer HackableMercurial python if availbale Currently hg.exe will only try to load python27.dll from hg-python subdir if PYTHONHOME environment variable is not set. I think that it is better to check whether 'hg-python' subdir exists and load python from it in that case, regardless of environment. This allows for reliable approach of distributing Mercurial with its own Python.
author Kostia Balytskyi <ikostia@fb.com>
date Mon, 13 Mar 2017 12:44:13 -0700
parents d2c40510104e
children 2372284d9457
line wrap: on
line source

from __future__ import absolute_import
import os

if os.environ.get('COVERAGE_PROCESS_START'):
    try:
        import coverage
        import uuid

        covpath = os.path.join(os.environ['COVERAGE_DIR'],
                               'cov.%s' % uuid.uuid1())
        cov = coverage.coverage(data_file=covpath, auto_data=True)
        cov._warn_no_data = False
        cov._warn_unimported_source = False
        cov.start()
    except ImportError:
        pass