github / github/codeql

LGTM.com - false positive "Statement has no effect" for Python await

Aperta
#11,235 2 commenti 2 reazioni 0 assegnatari Vedi su GitHub
false-positive
Lingua principale
CodeQL
Stelle
10.1k
Fork
2.1k
Merge medio
2g 15h
PR unite (30g)
141

Descrizione

**Description of the false positive**

The `await` expression is used to run coroutines, which by design have side-effects. However, CodeQL erroneously treats a bare `await` expression like any other bare expression and thus assumes it has no side-effects and is used in error. This leads to false-positive flags when `await` is used to trigger a side-effect without a return value.

```python3
def foo():
...
# close a critical resource
await aclose
```

**URL to the alert on the project page on ~~LGTM.com~~ GithHub**

https://github.com/maxfischer2781/asyncstdlib/security/code-scanning/9

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.