Skip to content

Commit b9f91bc

Browse files
Merge pull request #719 from insertinterestingnamehere/samefile
Remove dependence on os.path.samefile for Python 2.7 on Windows.
2 parents cbe939c + fccc5b3 commit b9f91bc

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@
55

66
import os, sys
77
from os import chdir, getcwd
8-
from os.path import abspath, dirname, split, samefile
8+
from os.path import abspath, dirname, split
99
import shlex, glob
1010
from subprocess import check_output
1111

1212
import re
1313
import argparse
1414

15+
if sys.platform == 'win32' and sys.version_info[0] < 3:
16+
def samefile(path1, path2):
17+
return (os.path.normcase(os.path.normpath(path1)) ==
18+
os.path.normcase(os.path.normpath(path2)))
19+
else:
20+
from os.path import samefile
21+
1522
# Pre-parse and remove the '--target' argument from sys.argv since we
1623
# need it here already.
1724
parser = argparse.ArgumentParser()

0 commit comments

Comments
 (0)