summaryrefslogtreecommitdiff
path: root/tests/try_execfile.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2014-12-27 10:01:32 -0500
committerNed Batchelder <ned@nedbatchelder.com>2014-12-27 10:01:32 -0500
commit280a9ab2056ae33616528955e99a419632d92b3b (patch)
treea782427b7ee29070c7aa7fa942cc00ee8956f873 /tests/try_execfile.py
parent213bb9e47da67363c7ad3b190b4498dc668f9066 (diff)
downloadpython-coveragepy-280a9ab2056ae33616528955e99a419632d92b3b.tar.gz
Two windows fixes for tests
Diffstat (limited to 'tests/try_execfile.py')
-rw-r--r--tests/try_execfile.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/try_execfile.py b/tests/try_execfile.py
index ee5bae5..e0b79b4 100644
--- a/tests/try_execfile.py
+++ b/tests/try_execfile.py
@@ -32,7 +32,12 @@ def same_file(p1, p2):
return False
if not os.path.exists(p2):
return False
- return os.path.samefile(p1, p2)
+ if hasattr(os.path, "samefile"):
+ return os.path.samefile(p1, p2)
+ else:
+ norm1 = os.path.normcase(os.path.normpath(p1))
+ norm2 = os.path.normcase(os.path.normpath(p2))
+ return norm1 == norm2
def without_same_files(filenames):
"""Return the list `filenames` with duplicates (by same_file) removed."""