python / python/cpython

`deque_clear` clears `MemoryError`

Aperta
#152,017 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@rhettinger ci sta già lavorando.

Dal 26/6/2026.

extension-modules type-bug
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

Bug report

Bug description:

This is a sub-issue for gh-146102 with the gist here.

In the case that there is no memory, deque_clear calls PyErr_Clear():
https://github.com/python/cpython/blob/7928a8b730b0334c9f97c2144ab00fe0d88f1e97/Modules/_collectionsmodule.c#L749-L753

This was done to clear the error that newblock raises. However, if there was originally an exception, deque_clear clears it.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs
  • gh-152018

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.