From 3b8f4a0b86f8796f1e7925b9c6593a9d5198b437 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 6 Oct 2015 07:14:18 -0400 Subject: Protect ourselves from mock'ed os. #416 --- coverage/files.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'coverage/files.py') diff --git a/coverage/files.py b/coverage/files.py index 2b8727d4..0b5651cb 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -13,12 +13,14 @@ import sys from coverage import env from coverage.backward import unicode_class -from coverage.misc import CoverageException, join_regex +from coverage.misc import CoverageException, join_regex, isolate_module RELATIVE_DIR = None CANONICAL_FILENAME_CACHE = {} +os = isolate_module(os) + def set_relative_directory(): """Set the directory that `relative_filename` will be relative to.""" -- cgit v1.2.1