Skip to content

Commit 7098998

Browse files
Update how-to-write-a-parser.md to not contain Ruff violations (#12214)
1 parent d2265c4 commit 7098998

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/content/en/open_source/contributing/how-to-write-a-parser.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Example of use:
177177
from cvss.cvss3 import CVSS3
178178
import cvss.parser
179179
vectors = cvss.parser.parse_cvss_from_text("CVSS:3.0/S:C/C:H/I:H/A:N/AV:P/AC:H/PR:H/UI:R/E:H/RL:O/RC:R/CR:H/IR:X/AR:X/MAC:H/MPR:X/MUI:X/MC:L/MA:X")
180-
if len(vectors) > 0 and type(vectors[0]) == CVSS3:
180+
if len(vectors) > 0 and type(vectors[0]) is CVSS3:
181181
print(vectors[0].severities()) # this is the 3 severities
182182

183183
cvssv3 = vectors[0].clean_vector()
@@ -192,7 +192,7 @@ Good example:
192192

193193
```python
194194
vectors = cvss.parser.parse_cvss_from_text(item['cvss_vect'])
195-
if len(vectors) > 0 and type(vectors[0]) == CVSS3:
195+
if len(vectors) > 0 and type(vectors[0]) is CVSS3:
196196
finding.cvss = vectors[0].clean_vector()
197197
finding.severity = vectors[0].severities()[0] # if your tool does generate severity
198198
```

0 commit comments

Comments
 (0)