github / github/codeql

LGTM.com - false positive

Abierto
#4,918 2 comentarios 0 reacciones 0 asignados Ver en GitHub
false-positive Python
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

**Description of the false positive**

LGTM.com alerted about "illegal raise", with the description "Illegal class 'NoneType' raised; will result in a TypeError being raised instead."

Refer to the [screenshot on Twitter](https://pbs.twimg.com/media/Eq8c3vTUwAEqlIU?format=png).

Code replicated:

```python
if self._thread_exception is not None: # pragma: nowsl
# See comment about WSL1.0 in the _run() method
raise self._thread_exception
```

As you can see, it is simply _impossible_ for `self._thread_exception` to be `None` when it's raised; the `if` statement on the first line guarantees that.

This occurred **twice** in the same file; see URLs below:

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

https://lgtm.com/projects/g/aio-libs/aiosmtpd/snapshot/1dc00d77a8767369d079567e4240b757a3e96d7b/files/aiosmtpd/controller.py?sort=name&dir=ASC&mode=heatmap#x5de8abb8d304cf9:1

and

https://lgtm.com/projects/g/aio-libs/aiosmtpd/snapshot/1dc00d77a8767369d079567e4240b757a3e96d7b/files/aiosmtpd/controller.py#x95bc8f7524427423:1

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.