summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/mkreal.py
Commit message (Expand)AuthorAgeFilesLines
* bpo-22831: Use "with" to avoid possible fd leaks in tools (part 2). (GH-10927)Serhiy Storchaka2019-03-301-8/+7
* convert shebang lines: python -> python3Benjamin Peterson2010-03-111-1/+1
* Convert print statements to function calls in Tools/.Collin Winter2007-08-031-2/+2
* [Patch #1005491 ] use __name__ == '__main__' in scriptsAndrew M. Kuchling2004-08-091-1/+2
* Fix use of 'file' as a variable name.Andrew M. Kuchling2003-05-131-3/+3
* Whitespace normalization.Tim Peters2001-01-171-42/+42
* /usr/local/bin/python -> /usr/bin/env pythonGuido van Rossum1996-11-271-1/+1
* MicrofixesGuido van Rossum1993-04-011-1/+2
* change posix to osGuido van Rossum1992-03-301-19/+18
* Renamed path.cat to path.join.Guido van Rossum1991-07-011-3/+3
* Initial revisionGuido van Rossum1991-06-041-0/+65
l opt">("dwFileType", DWORD), ("dwFileSubtype", DWORD), ("dwFileDateMS", DWORD), ("dwFileDateLS", DWORD), ] kernel32 = WinDLL('kernel32') version = WinDLL('version') if len(sys.argv) < 2: print('Usage: validate_ucrtbase.py <ucrtbase|ucrtbased>') sys.exit(2) try: ucrtbased = WinDLL(sys.argv[1]) except OSError: print('Cannot find ucrtbased.dll') # This likely means that VS is not installed, but that is an # obvious enough problem if you're trying to produce a debug # build that we don't need to fail here. sys.exit(0) # We will immediately double the length up to MAX_PATH, but the # path may be longer, so we retry until the returned string is # shorter than our buffer. name_len = actual_len = 130 while actual_len == name_len: name_len *= 2 name = create_unicode_buffer(name_len) actual_len = kernel32.GetModuleFileNameW(HANDLE(ucrtbased._handle), name, len(name)) if not actual_len: print('Failed to get full module name.') sys.exit(2) size = version.GetFileVersionInfoSizeW(name, None) if not size: print('Failed to get size of version info.') sys.exit(2) ver_block = c_buffer(size) if (not version.GetFileVersionInfoW(name, None, size, ver_block) or not ver_block): print('Failed to get version info.') sys.exit(2) pvi = POINTER(VS_FIXEDFILEINFO)() if not version.VerQueryValueW(ver_block, "", byref(pvi), byref(DWORD())): print('Failed to get version value from info.') sys.exit(2) ver = ( pvi.contents.dwProductVersionMS >> 16, pvi.contents.dwProductVersionMS & 0xFFFF, pvi.contents.dwProductVersionLS >> 16, pvi.contents.dwProductVersionLS & 0xFFFF, ) print('{} is version {}.{}.{}.{}'.format(name.value, *ver)) if ver < (10, 0, 10586): print('WARN: ucrtbased contains known issues. ' 'Please update the Windows 10 SDK.') print('See:') print(' http://bugs.python.org/issue27705') print(' https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk') sys.exit(1)