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 e089c72

Browse filesBrowse files
committed
More robust test for the _partialmethod attribute.
The asyncio tests pass in a mock.Mock() instance and it always has any attribute, so the test enters an infinite loop. This change avoids that trap.
1 parent 4fecb83 commit e089c72
Copy full SHA for e089c72

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+2
-2
lines changed

‎Lib/functools.py

Copy file name to clipboardExpand all lines: Lib/functools.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ def _unwrap_partialmethod(func):
417417
prev = None
418418
while func is not prev:
419419
prev = func
420-
while hasattr(func, "_partialmethod"):
421-
func = getattr(func, '_partialmethod')
420+
while isinstance(getattr(func, "_partialmethod", None), partialmethod):
421+
func = func._partialmethod
422422
while isinstance(func, partialmethod):
423423
func = getattr(func, 'func')
424424
func = _unwrap_partial(func)

0 commit comments

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