Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1888)

Unified Diff: third_party/coverage-3.7.1/__main__.py

Issue 225633007: Upgrade to coverage 3.7.1 and have it auto-build itself on first use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: sigh our imports are a mess Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/coverage-3.7.1/README.txt ('k') | third_party/coverage-3.7.1/coverage.egg-info/PKG-INFO » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/coverage-3.7.1/__main__.py
diff --git a/third_party/coverage-3.7.1/__main__.py b/third_party/coverage-3.7.1/__main__.py
new file mode 100644
index 0000000000000000000000000000000000000000..b11dafce6d551111e7bf5a807cb6037beb448cc6
--- /dev/null
+++ b/third_party/coverage-3.7.1/__main__.py
@@ -0,0 +1,15 @@
+"""Be able to execute coverage.py by pointing Python at a working tree."""
+
+import runpy, os
+
+PKG = 'coverage'
+
+try:
+ run_globals = runpy.run_module(PKG, run_name='__main__', alter_sys=True)
+ executed = os.path.splitext(os.path.basename(run_globals['__file__']))[0]
+ if executed != '__main__': # For Python 2.5 compatibility
+ raise ImportError(
+ 'Incorrectly executed %s instead of __main__' % executed
+ )
+except ImportError: # For Python 2.6 compatibility
+ runpy.run_module('%s.__main__' % PKG, run_name='__main__', alter_sys=True)
« no previous file with comments | « third_party/coverage-3.7.1/README.txt ('k') | third_party/coverage-3.7.1/coverage.egg-info/PKG-INFO » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698