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

Side by Side Diff: third_party/coverage-3.7.1/coverage/fullcoverage/encodings.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, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 """Imposter encodings module that installs a coverage-style tracer. 1 """Imposter encodings module that installs a coverage-style tracer.
2 2
3 This is NOT the encodings module; it is an imposter that sets up tracing 3 This is NOT the encodings module; it is an imposter that sets up tracing
4 instrumentation and then replaces itself with the real encodings module. 4 instrumentation and then replaces itself with the real encodings module.
5 5
6 If the directory that holds this file is placed first in the PYTHONPATH when 6 If the directory that holds this file is placed first in the PYTHONPATH when
7 using "coverage" to run Python's tests, then this file will become the very 7 using "coverage" to run Python's tests, then this file will become the very
8 first module imported by the internals of Python 3. It installs a 8 first module imported by the internals of Python 3. It installs a
9 coverage-compatible trace function that can watch Standard Library modules 9 coverage-compatible trace function that can watch Standard Library modules
10 execute from the very earliest stages of Python's own boot process. This fixes 10 execute from the very earliest stages of Python's own boot process. This fixes
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 # Finally, remove our own directory from sys.path; remove ourselves from 48 # Finally, remove our own directory from sys.path; remove ourselves from
49 # sys.modules; and re-import "encodings", which will be the real package 49 # sys.modules; and re-import "encodings", which will be the real package
50 # this time. Note that the delete from sys.modules dictionary has to 50 # this time. Note that the delete from sys.modules dictionary has to
51 # happen last, since all of the symbols in this module will become None 51 # happen last, since all of the symbols in this module will become None
52 # at that exact moment, including "sys". 52 # at that exact moment, including "sys".
53 53
54 parentdir = max(filter(__file__.startswith, sys.path), key=len) 54 parentdir = max(filter(__file__.startswith, sys.path), key=len)
55 sys.path.remove(parentdir) 55 sys.path.remove(parentdir)
56 del sys.modules['encodings'] 56 del sys.modules['encodings']
57 import encodings 57 import encodings
OLDNEW
« no previous file with comments | « third_party/coverage-3.7.1/coverage/files.py ('k') | third_party/coverage-3.7.1/coverage/html.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698