mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
gh-102336: Remove code specifically for handling Windows 7 (GH-102337)
This commit is contained in:
parent
360ef843d8
commit
938e36f824
7 changed files with 56 additions and 159 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue