A reproducible example:

```
import traceback
X = None
try:
    X.text
except (TypeError, AttributeError) as e:
    traceback.print_exc(e)

```

This will raise an error at `traceback.print_exc(e)`:

`TypeError: '>=' not supported between instances of 'AttributeError' and 'int'`

Any suggestion why this happens?