Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 78ad7e6

Browse filesBrowse files
authored
gh-126499: test_ssl: Don't assume err.reason is a string (GH-126501)
The skipping machinery called `getattr(err, "reason", "")` on an arbitrary exception. As intermittent Buildbot failures show, sometimes it's set to None. Convert it to string for this specific check.
1 parent 1fe67df commit 78ad7e6
Copy full SHA for 78ad7e6

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎Lib/test/test_ssl.py

Copy file name to clipboardExpand all lines: Lib/test/test_ssl.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5029,7 +5029,7 @@ def non_linux_skip_if_other_okay_error(self, err):
50295029
return # Expect the full test setup to always work on Linux.
50305030
if (isinstance(err, ConnectionResetError) or
50315031
(isinstance(err, OSError) and err.errno == errno.EINVAL) or
5032-
re.search('wrong.version.number', getattr(err, "reason", ""), re.I)):
5032+
re.search('wrong.version.number', str(getattr(err, "reason", "")), re.I)):
50335033
# On Windows the TCP RST leads to a ConnectionResetError
50345034
# (ECONNRESET) which Linux doesn't appear to surface to userspace.
50355035
# If wrap_socket() winds up on the "if connected:" path and doing

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.