mirror of
https://github.com/python/cpython
synced 2024-09-05 08:17:45 +00:00
closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against old OpenSSL. (GH-19506)
This commit is contained in:
parent
02152b7332
commit
584a3cfda4
2496
Modules/_ssl_data.h
2496
Modules/_ssl_data.h
File diff suppressed because it is too large
Load diff
|
@ -46,9 +46,13 @@ def parse_error_codes(h_file, prefix, libcode):
|
|||
continue
|
||||
mnemonic = base[:-5].upper()
|
||||
if mnemonic == "":
|
||||
# Skip err.h.
|
||||
continue
|
||||
error_libraries[mnemonic] = (f'ERR_LIB_{mnemonic}', f'{mnemonic}_R_', error_header)
|
||||
# err.h
|
||||
lib_codes = {
|
||||
code: num
|
||||
for (code, (_, _, num)) in parse_error_codes(error_header, 'ERR_LIB_', None)
|
||||
}
|
||||
else:
|
||||
error_libraries[mnemonic] = (f'ERR_LIB_{mnemonic}', f'{mnemonic}_R_', error_header)
|
||||
|
||||
# Read codes from libraries
|
||||
new_codes = []
|
||||
|
@ -88,7 +92,7 @@ def w(l):
|
|||
w(' #ifdef %s' % (errcode))
|
||||
w(' {"%s", %s, %s},' % (name, libcode, errcode))
|
||||
w(' #else')
|
||||
w(' {"%s", %s, %d},' % (name, libcode, num))
|
||||
w(' {"%s", %s, %d},' % (name, lib_codes[libcode], num))
|
||||
w(' #endif')
|
||||
w(' { NULL }')
|
||||
w('};')
|
||||
|
|
Loading…
Reference in a new issue