]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
> Some of the code sets the error string in this directly before
authorGuido van Rossum <guido@python.org>
Mon, 27 Aug 2007 18:42:23 +0000 (18:42 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 27 Aug 2007 18:42:23 +0000 (18:42 +0000)
commit780b80dc086809f0fa6ccc2508f5ede585151625
treec222c2a59bc883b202230612c6bebc5161068355
parentba8c5653cc9d2777f8becacad122801a388d6cff
> Some of the code sets the error string in this directly before
> returning NULL, and other pieces of the code call PySSL_SetError,
> which creates the error string.  I think some of the places which set
> the string directly probably shouldn't; instead, they should call
> PySSL_SetError to cons up the error name directly from the err code.
> However, PySSL_SetError only works after the construction of an ssl
> object, which means it can't be used there...  I'll take a longer look
> at it and see if there's a reasonable fix.

Here's a patch which addresses this.  It also fixes the indentation in
PySSL_SetError, bringing it into line with PEP 7, fixes a compile warning
about one of the OpenSSL macros, and makes the namespace a bit more
consistent.  I've tested it on FC 7 and OS X 10.4.

% ./python ./Lib/test/regrtest.py -R :1: -u all test_ssl
test_ssl
beginning 6 repetitions
123456
......
1 test OK.
[29244 refs]
%

[GvR: slightly edited to enforce 79-char line length, even if it required
 violating the style guide.]
Modules/_ssl.c