Don't try to access sys.getwindowsversion unless it exists (ntpath is

imported on systems other than Windows, and in particular is imported
by test___all__; the compile farm reported that all Linux tests failed
due to this; isn't anyone in PythonDevLand running CVS on Linux?!).
This commit is contained in:
Tim Peters 2002-10-09 07:56:04 +00:00
parent 2a182dbf3f
commit 26bc25a6c4
1 changed files with 2 additions and 1 deletions

View File

@ -479,4 +479,5 @@ def abspath(path):
# realpath is a no-op on systems without islink support
realpath = abspath
# Win9x family and earlier have no Unicode filename support.
supports_unicode_filenames = sys.getwindowsversion()[3] >= 2
supports_unicode_filenames = (hasattr(sys, "getwindowsversion") and
sys.getwindowsversion()[3] >= 2)