Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 584a3cf

Browse files
authoredApr 14, 2020
closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against old OpenSSL. (pythonGH-19506)
1 parent 02152b7 commit 584a3cf

File tree

2 files changed

+1256
-1252
lines changed

2 files changed

+1256
-1252
lines changed
 

‎Modules/_ssl_data.h

Lines changed: 1248 additions & 1248 deletions
Large diffs are not rendered by default.

‎Tools/ssl/make_ssl_data.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ def parse_error_codes(h_file, prefix, libcode):
4646
continue
4747
mnemonic = base[:-5].upper()
4848
if mnemonic == "":
49-
# Skip err.h.
50-
continue
51-
error_libraries[mnemonic] = (f'ERR_LIB_{mnemonic}', f'{mnemonic}_R_', error_header)
49+
# err.h
50+
lib_codes = {
51+
code: num
52+
for (code, (_, _, num)) in parse_error_codes(error_header, 'ERR_LIB_', None)
53+
}
54+
else:
55+
error_libraries[mnemonic] = (f'ERR_LIB_{mnemonic}', f'{mnemonic}_R_', error_header)
5256

5357
# Read codes from libraries
5458
new_codes = []
@@ -88,7 +92,7 @@ def w(l):
8892
w(' #ifdef %s' % (errcode))
8993
w(' {"%s", %s, %s},' % (name, libcode, errcode))
9094
w(' #else')
91-
w(' {"%s", %s, %d},' % (name, libcode, num))
95+
w(' {"%s", %s, %d},' % (name, lib_codes[libcode], num))
9296
w(' #endif')
9397
w(' { NULL }')
9498
w('};')

0 commit comments

Comments
 (0)
Please sign in to comment.