Skip to content

Commit fc02aa8

Browse files
committed
fix remaining resourcewarnings
1 parent cb1c7e5 commit fc02aa8

File tree

2 files changed

+4
-2
lines changed
  • cmake_file_api/kinds

2 files changed

+4
-2
lines changed

cmake_file_api/kinds/codemodel/target/v2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,8 @@ def from_dict(cls, dikt: dict[str, Any], reply_path: Path) -> "CodemodelTargetV2
499499

500500
@classmethod
501501
def from_path(cls, file: Path, reply_path: Path) -> "CodemodelTargetV2":
502-
dikt = json.load(file.open())
502+
with file.open() as file:
503+
dikt = json.load(file)
503504
return cls.from_dict(dikt, reply_path)
504505

505506
def __repr__(self) -> str:

cmake_file_api/kinds/configureLog/target/v2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,8 @@ def from_dict(cls, dikt: dict[str, Any]) -> "CodemodelTargetV2":
498498

499499
@classmethod
500500
def from_path(cls, file: Path) -> "CodemodelTargetV2":
501-
dikt = json.load(file.open())
501+
with file.open() as file:
502+
dikt = json.load(file)
502503
return cls.from_dict(dikt)
503504

504505
def __repr__(self) -> str:

0 commit comments

Comments
 (0)