Skip to content

Commit 0186a2e

Browse files
🐛 fix PTH123 ruff rule on dev branch (#12108)
1 parent cbe8cbc commit 0186a2e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dojo/tools/anchore_engine/parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
from pathlib import Path
23

34
from dojo.models import Finding
45

@@ -17,7 +18,7 @@ def get_findings(self, filename, test):
1718
try:
1819
data = json.load(filename)
1920
except AttributeError:
20-
with open(filename, encoding="utf-8") as file:
21+
with Path(filename).open(encoding="utf-8") as file:
2122
data = json.load(file)
2223
if data.get("metadata"):
2324
return self.get_findings_with_metadata(data, test)

0 commit comments

Comments
 (0)