Skip to content

Commit

Permalink
Correct context manage file opening
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmundt committed Nov 20, 2023
1 parent 7bf0f7f commit 1edc3b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyomo/solver/IPOPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ def solve(self, model, **kwds):
f"NL file with the same name {basename + '.nl'} already exists!"
)
with (
open(basename + '.nl', 'w') as nl_file,
open(basename + '.row', 'w') as row_file,
open(basename + '.col', 'w') as col_file,
open(os.path.join(basename, '.nl'), 'w') as nl_file,
open(os.path.join(basename, '.row'), 'w') as row_file,
open(os.path.join(basename, '.col'), 'w') as col_file,
):
self.info = nl_writer.write(
model,
Expand Down

0 comments on commit 1edc3b5

Please sign in to comment.