Skip to content

Commit

Permalink
pyverilog: fix resource leak
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Jan 3, 2024
1 parent 35d244f commit 1950227
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyverilog/vparser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2307,7 +2307,8 @@ def __init__(self, filelist, preprocess_output='preprocess.output',

def preprocess(self):
self.preprocessor.preprocess()
text = open(self.preprocess_output).read()
with open(self.preprocess_output) as f:
text = f.read()
os.remove(self.preprocess_output)
return text

Expand Down

0 comments on commit 1950227

Please sign in to comment.