Skip to content

Commit

Permalink
Fix (not) handling exceptions when creating processes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekker1 committed Oct 27, 2023
1 parent 0125a2f commit 1bf1221
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ Changed
``timeout`` parameter is still accepted, but will add a
``DeprecationWarning`` and will be removed in future versions.

Fixed
^^^^^

- Fix problem where some exceptions when creating processes where hidden and
would then cause errors where the ``proc`` variable did not exist.

0.9.0_ - 2023-04-04
-------------------

Expand Down
4 changes: 2 additions & 2 deletions src/minizinc/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ async def solutions(
# Whether the status has changed since the last `yield`
status_changed = False

# Run the MiniZinc process
proc = await self._driver._create_process(cmd, solver=solver)
try:
# Run the MiniZinc process
proc = await self._driver._create_process(cmd, solver=solver)
assert isinstance(proc.stderr, asyncio.StreamReader)
assert isinstance(proc.stdout, asyncio.StreamReader)

Expand Down

0 comments on commit 1bf1221

Please sign in to comment.