github / github/codeql

assignment is unnessary under suppress()

Aperta
#7,638 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
false-positive not security Python
Lingua principale
CodeQL
Stelle
10.1k
Fork
2.1k
Merge medio
2g 15h
PR unite (30g)
141

Descrizione

Maybe a bit of an edge case, but this code gives warning of unnessary assignments:
```
t = "<>"
with suppress(AttributeError):
# Set to type arg.
t = cls = get_args(self.__orig_class__)[0]
# If a class, set to the qualname.
t = cls.__qualname__
```

It should probably recognise that any code in a `suppress()` block may not actually run to completion.

https://lgtm.com/projects/g/aio-libs/aiohttp/snapshot/d6d827d7b26f2a54999f8a150ef230fe627aa435/files/aiohttp/helpers.py?sort=name&dir=ASC&mode=heatmap#x6cb8804f71fae0f2:1

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.