Skip to content

Commit

Permalink
Fix: Incorrectly handles stderr outputs that aren't errors from libng…
Browse files Browse the repository at this point in the history
…spice version 43

**Fixes PySpice-org#379**

This pull request addresses an issue where PySpice incorrectly handles certain stderr outputs from libngspice version 43, specifically messages like "Using SPARSE 1.3 as Direct Linear Solver". These messages, while appearing on stderr, are informational and not indicative of errors.

**Changes:**

- Modified the `_send_char` callback in `Spice/NgSpice/Shared.py` to specifically handle messages starting with "Using".
- These messages are now treated as debug output instead of errors, preventing the `self._error_in_stderr` flag from being set and avoiding the `NgSpiceCommandError`.
  • Loading branch information
Kreijstal authored Oct 28, 2024
1 parent fe08718 commit 7fd7623
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PySpice/Spice/NgSpice/Shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,8 @@ def _send_char(message_c, ngspice_id, user_data):
self._stderr.append(content)
if content.startswith('Warning:'):
func = self._logger.warning
# elif content.startswith('Warning:'):
elif content.startswith('Using'): # Ignore "Using ... as Direct Linear Solver" messages
func = self._logger.debug
else:
self._error_in_stderr = True
func = self._logger.error
Expand Down

0 comments on commit 7fd7623

Please sign in to comment.