mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-29762: More use "raise from None". (#569)
This hides unwanted implementation details from tracebacks.
This commit is contained in:
parent
43ba8861e0
commit
5affd23e6f
30 changed files with 50 additions and 48 deletions
|
|
@ -98,7 +98,7 @@ class WeakSet:
|
|||
try:
|
||||
itemref = self.data.pop()
|
||||
except KeyError:
|
||||
raise KeyError('pop from empty WeakSet')
|
||||
raise KeyError('pop from empty WeakSet') from None
|
||||
item = itemref()
|
||||
if item is not None:
|
||||
return item
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue