Skip to content

Commit b85883d

Browse files
committed
add comment to explain the modification reasons
1 parent 81f8135 commit b85883d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/kaocha/api.clj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
;; Prevent clj-refactor from "cleaning" these from the ns form
1818
(require 'kaocha.monkey-patch)
1919

20+
;; Before orig-out was set to *out*, and unfortunately that will
21+
;; cause a ClassCastException.
22+
;; => "java.io.OutputStreamWriter cannot be cast to java.io.PrintStream"
23+
;; Explanation:
24+
;; The exception is because that when user interruption happens,
25+
;; Kaocha will force resetting printing to stdout. However, *out*
26+
;; is of class java.io.OutputStreamWriter, but System/out is of
27+
;; class java.io.PrintStream
2028
(def orig-out System/out)
2129
(def orig-err System/err)
2230

0 commit comments

Comments
 (0)