gh-102336: Remove code specifically for handling Windows 7 (GH-102337)

This commit is contained in:
Max Bachmann 2023-03-01 01:31:21 +01:00 committed by GitHub
parent 360ef843d8
commit 938e36f824
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 56 additions and 159 deletions

View file

@ -227,12 +227,11 @@ getpath_isxfile(PyObject *Py_UNUSED(self), PyObject *args)
path = PyUnicode_AsWideCharString(pathobj, &cchPath);
if (path) {
#ifdef MS_WINDOWS
const wchar_t *ext;
DWORD attr = GetFileAttributesW(path);
r = (attr != INVALID_FILE_ATTRIBUTES) &&
!(attr & FILE_ATTRIBUTE_DIRECTORY) &&
SUCCEEDED(PathCchFindExtension(path, cchPath + 1, &ext)) &&
(CompareStringOrdinal(ext, -1, L".exe", -1, 1 /* ignore case */) == CSTR_EQUAL)
(cchPath >= 4) &&
(CompareStringOrdinal(path + cchPath - 4, -1, L".exe", -1, 1 /* ignore case */) == CSTR_EQUAL)
? Py_True : Py_False;
#else
struct stat st;