src/module-impl.lisp: Don't emit `#line' to non-position-aware streams.
[sod] / src / module-impl.lisp
index 9e74b27..fe6b545 100644 (file)
         (line (file-location-line location))
         (filename (file-location-filename location)))
     (cond (line
-          (format stream "~&#line ~D~@[ ~S~]~%" line filename)
+          (when (typep stream 'position-aware-stream)
+            (format stream "~&#line ~D~@[ ~S~]~%" line filename))
           (funcall thunk)
           (when (typep stream 'position-aware-stream)
             (fresh-line stream)