diff frontends/src/jp/base.py @ 2193:33b82250eadd

jp (base): raise InternalError if output is used when use_output is not declared
author Goffi <goffi@goffi.org>
date Mon, 13 Mar 2017 23:14:00 +0100
parents a25a256688e2
children 1010054cf771
line wrap: on
line diff
--- a/frontends/src/jp/base.py	Mon Mar 13 23:12:57 2017 +0100
+++ b/frontends/src/jp/base.py	Mon Mar 13 23:14:00 2017 +0100
@@ -753,7 +753,11 @@
         return self.host.disp(msg, verbosity, error)
 
     def output(self, data):
-        return self.host.output(self._output_type, self.args.output, self.extra_outputs, data)
+        try:
+            output_type = self._output_type
+        except AttributeError:
+            raise exceptions.InternalError(_(u'trying to use output when use_output has not been set'))
+        return self.host.output(output_type, self.args.output, self.extra_outputs, data)
 
     def errback(self, failure_):
         """generic callback for errbacks