summaryrefslogtreecommitdiff
path: root/scheme/racket/geiser/eval.rkt
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2011-11-26 07:11:26 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2011-11-26 07:11:26 +0100
commit9857c254979e7c43a3f432c1927a168d6437398c (patch)
tree14bd049420925ee7045fab9963f9161b0fa6b58c /scheme/racket/geiser/eval.rkt
parent8167ddb673800b43d78b6164673506e6d6fd6ef7 (diff)
downloadgeiser-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.rkt5
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)