Make 'echo' raise IOErrors when appropriate (#16367)

* Make 'echo' raise IOError when fwrite/fflush fail

* Fix fwrite return value comparison

* Add test for echo raising error and don't fail to release locks in echo

* Fix exitcode expectation

* Make 'echo' raise IOError on Windows if it fails

* Add nimLegacyEchoNoRaise for prior no-IOError echo behavior

* Use checkErrMaybe template
This commit is contained in:
Matt Haggard 2020-12-18 04:06:13 -05:00 • committed by GitHub
commit 23d23ecb08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 8 deletions

View file

@ -63,6 +63,9 @@
- Added `math.isNaN`.
- `echo` and `debugEcho` will now raise `IOError` if writing to stdout fails. Previous behavior
silently ignored errors. See #16366. Use `-d:nimLegacyEchoNoRaise` for previous behavior.
## Language changes
- `nimscript` now handles `except Exception as e`.