]> granicus.if.org Git - python/commitdiff
Don't try to access sys.getwindowsversion unless it exists (ntpath is
authorTim Peters <tim.peters@gmail.com>
Wed, 9 Oct 2002 07:56:04 +0000 (07:56 +0000)
committerTim Peters <tim.peters@gmail.com>
Wed, 9 Oct 2002 07:56:04 +0000 (07:56 +0000)
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?!).

Lib/ntpath.py

index 73b7a2fdca05300588a267f6a88a7210eaba3baa..0f1dd4dc608aa2f15fc457cb6ac59d40edbfab6d 100644 (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)