diff options
Diffstat (limited to 'coverage/fullcoverage/encodings.py')
-rw-r--r-- | coverage/fullcoverage/encodings.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/coverage/fullcoverage/encodings.py b/coverage/fullcoverage/encodings.py index 4e1ab354..9409b7d7 100644 --- a/coverage/fullcoverage/encodings.py +++ b/coverage/fullcoverage/encodings.py @@ -43,8 +43,8 @@ sys.settrace(FullCoverageTracer().fullcoverage_trace) # happen last, since all of the symbols in this module will become None # at that exact moment, including "sys". -import os -this = os.path.dirname(__file__) -sys.path.remove(this) +parentdirs = [ d for d in sys.path if __file__.startswith(d) ] +parentdirs.sort(key=len) +sys.path.remove(parentdirs[-1]) del sys.modules['encodings'] import encodings |