summaryrefslogtreecommitdiff
path: root/coverage/files.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/files.py')
-rw-r--r--coverage/files.py20
1 files changed, 4 insertions, 16 deletions
diff --git a/coverage/files.py b/coverage/files.py
index d6826830..f7272bd7 100644
--- a/coverage/files.py
+++ b/coverage/files.py
@@ -13,7 +13,6 @@ import re
import sys
from coverage import env
-from coverage.backward import unicode_class
from coverage.misc import contract, CoverageException, join_regex, isolate_module
@@ -105,8 +104,6 @@ if env.WINDOWS:
def actual_path(path):
"""Get the actual path of `path`, including the correct case."""
- if env.PY2 and isinstance(path, unicode_class):
- path = path.encode(sys.getfilesystemencoding())
if path in _ACTUAL_PATH_CACHE:
return _ACTUAL_PATH_CACHE[path]
@@ -143,19 +140,10 @@ else:
return filename
-if env.PY2:
- @contract(returns='unicode')
- def unicode_filename(filename):
- """Return a Unicode version of `filename`."""
- if isinstance(filename, str):
- encoding = sys.getfilesystemencoding() or sys.getdefaultencoding()
- filename = filename.decode(encoding, "replace")
- return filename
-else:
- @contract(filename='unicode', returns='unicode')
- def unicode_filename(filename):
- """Return a Unicode version of `filename`."""
- return filename
+@contract(filename='unicode', returns='unicode')
+def unicode_filename(filename):
+ """Return a Unicode version of `filename`."""
+ return filename
@contract(returns='unicode')