Skip to content

Commit fccc5b3

Browse files
Remove dependence on os.path.samefile for Python 2.7 on Windows.
Closes #711.
1 parent cbe939c commit fccc5b3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

setup.py

+8-1
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)