◐ Shell
clean mode source ↗

[C API] Use new PyDict_GetItemRef() C API

Bug report

Checklist

  • I am confident this is a bug in CPython, not a bug in a third-party project
  • I have searched the CPython issue tracker,
    and am confident this bug has not been reported before

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

No response

A clear and concise description of the bug:

Calls to PyDict_GetItem() should be replaced with PyDict_GetItemRef().

PyDict_GetItemWithError() may also be replaced with PyDict_GetItemRef().

Linked PRs