diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2011-11-26 07:11:26 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2011-11-26 07:11:26 +0100 |
commit | 9857c254979e7c43a3f432c1927a168d6437398c (patch) | |
tree | 14bd049420925ee7045fab9963f9161b0fa6b58c /scheme/racket/geiser/eval.rkt | |
parent | 8167ddb673800b43d78b6164673506e6d6fd6ef7 (diff) | |
download | geiser-guile-9857c254979e7c43a3f432c1927a168d6437398c.tar.gz geiser-guile-9857c254979e7c43a3f432c1927a168d6437398c.tar.bz2 |
Racket: capturing and displaying standard error during evaluation
This bugs was exposed by using rackunit, where all the output of, say,
check-eq? was lost for good (it was being sent to the stderr black
hole).
Hat tip Grant Retkke.
Diffstat (limited to 'scheme/racket/geiser/eval.rkt')
-rw-r--r-- | scheme/racket/geiser/eval.rkt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scheme/racket/geiser/eval.rkt b/scheme/racket/geiser/eval.rkt index a59e275..26ad959 100644 --- a/scheme/racket/geiser/eval.rkt +++ b/scheme/racket/geiser/eval.rkt @@ -47,8 +47,9 @@ (let ([output (with-output-to-string (lambda () - (with-handlers ([exn? set-last-error]) - (call-with-values thunk set-last-result))))]) + (parameterize ([current-error-port (current-output-port)]) + (with-handlers ([exn? set-last-error]) + (call-with-values thunk set-last-result)))))]) (append last-result `((output . ,output))))) (define (eval-in form spec lang) |