tools/gn: make defined(foo.bar) an error if !defined(foo)
[chromium-blink-merge.git] / third_party / pycoverage / __main__.py
blobb11dafce6d551111e7bf5a807cb6037beb448cc6
1 """Be able to execute coverage.py by pointing Python at a working tree."""
3 import runpy, os
5 PKG = 'coverage'
7 try:
8 run_globals = runpy.run_module(PKG, run_name='__main__', alter_sys=True)
9 executed = os.path.splitext(os.path.basename(run_globals['__file__']))[0]
10 if executed != '__main__': # For Python 2.5 compatibility
11 raise ImportError(
12 'Incorrectly executed %s instead of __main__' % executed
14 except ImportError: # For Python 2.6 compatibility
15 runpy.run_module('%s.__main__' % PKG, run_name='__main__', alter_sys=True)