Skip to content

Commit

Permalink
Emma learns what for-else does
Browse files Browse the repository at this point in the history
  • Loading branch information
emma58 committed Aug 19, 2024
1 parent a477a02 commit 233b016
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyomo/contrib/piecewise/triangulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,11 @@ def _fix_vertices_incremental_order(simplices):
if simplex[n] in simplices[i + 1] and n != first:
last = n
break
if first is None or last is None:
raise DeveloperError("Couldn't fix vertex ordering for incremental.")
else:
# For the Python neophytes in the audience (and other sane
# people), the 'else' only runs if we do *not* break out of the
# for loop.
raise DeveloperError("Couldn't fix vertex ordering for incremental.")

# reorder the simplex with the desired first and last
new_simplex = list(simplex)
Expand Down

0 comments on commit 233b016

Please sign in to comment.