Skip to content

Commit

Permalink
add guard for symbolic_solver_labels=False
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiirola committed Feb 13, 2024
1 parent 9764b84 commit 1462403
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyomo/repn/plugins/nl_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,9 @@ def __call__(self, model, filename, solver_capability, io_options):
# This exception is included for compatibility with the
# original NL writer v1.
os.remove(filename)
os.remove(row_fname)
os.remove(col_fname)
if config.symbolic_solver_labels:
os.remove(row_fname)
os.remove(col_fname)
raise ValueError(
"No variables appear in the Pyomo model constraints or"
" objective. This is not supported by the NL file interface"
Expand Down

0 comments on commit 1462403

Please sign in to comment.