Two bugs:
framelocalsproxy_inplace_or(line 573) returnsPy_NotImplementedinstead ofNULLwhen merge fails → exceptions silently discarded.framelocalsproxy_update(line 730) unconditionally replaces any exception with TypeError.
import sys
frame = sys._getframe()
locs = frame.f_locals
class BadDict(dict):
def keys(self):
raise RuntimeError("keys() failed!")
# Bug 1: |= swallows the error
try:
locs |= BadDict()
print("|= silently swallowed RuntimeError (BUG)")
except RuntimeError:
print("|= correctly propagated")
# Bug 2: .update() replaces RuntimeError with TypeError
try:
locs.update(BadDict())
except TypeError:
print("update() masked RuntimeError as TypeError (BUG)")
except RuntimeError:
print("update() correctly propagated")