Commit 1b72b88
authored
ref(transport): Remove redundant checks for dsn (#6104)
### Description
#### Related Issue
* Fixes #6089
#### What changed
Removed the redundant `is not None` check from the DSN conditional
statement in `Transport.init` (`transport.py`).
**Code Comparison:**
```python
# Before
if options and options["dsn"] is not None and options["dsn"]:
# After
if options and options["dsn"]:
```
#### Why
In Python, the truthiness check (`options["dsn"]`) inherently evaluates
`None` as falsy. Therefore, the explicit `is not None` guard is
redundant. Removing it simplifies the logic while maintaining the same
behavior.
#### Notes
* **Why not use `options.get('dsn')`?** While `.get()` is often used for
safe dictionary access, a default value for `"dsn"` is already
guaranteed in this context, so there is no risk of a `KeyError`.
* **Consistency:** I intentionally kept the direct dictionary access
(`options["dsn"]`) to remain consistent with the existing coding pattern
used later in the same file (e.g., line 1165: `if options["dsn"]:`).1 parent 1faec55 commit 1b72b88
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
0 commit comments