File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -642,12 +642,17 @@ def relpath(path, start=curdir):
642642
643643# determine if two files are in fact the same file
644644try :
645- from nt import _getfinalpathname
646- except (NotImplementedError , ImportError ):
645+ # GetFinalPathNameByHandle is available starting with Windows 6.0.
646+ # Windows XP and non-Windows OS'es will mock _getfinalpathname.
647+ if sys .getwindowsversion ()[:2 ] >= (6 , 0 ):
648+ from nt import _getfinalpathname
649+ else :
650+ raise ImportError
651+ except (AttributeError , ImportError ):
647652 # On Windows XP and earlier, two files are the same if their absolute
648653 # pathnames are the same.
649- # Also, on other operating systems, fake this method with a
650- # Windows-XP approximation.
654+ # Non-Windows operating systems fake this method with an XP
655+ # approximation.
651656 def _getfinalpathname (f ):
652657 return abspath (f )
653658
You can’t perform that action at this time.
0 commit comments