[Python-checkins] cpython (merge 3.6 -> default): Closes #29308: Merged fix from 3.6.