From: Tim Peters Date: Wed, 9 Oct 2002 07:56:04 +0000 (+0000) Subject: Don't try to access sys.getwindowsversion unless it exists (ntpath is X-Git-Tag: v2.3c1~3851 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26bc25a6c4c377f553ff401dd993d8196da9438d;p=python 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?!). --- diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 73b7a2fdca..0f1dd4dc60 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -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)