summaryrefslogtreecommitdiff
path: root/distbuild/jm.py
diff options
context:
space:
mode:
Diffstat (limited to 'distbuild/jm.py')
-rw-r--r--distbuild/jm.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/distbuild/jm.py b/distbuild/jm.py
index 1277b4db..68fb6088 100644
--- a/distbuild/jm.py
+++ b/distbuild/jm.py
@@ -105,8 +105,13 @@ class JsonMachine(StateMachine):
line = line.rstrip()
if self.debug_json:
logging.debug('JsonMachine: line: %s' % repr(line))
- msg = yaml.load(json.loads(line))
- self.mainloop.queue_event(self, JsonNewMessage(msg))
+ msg = None
+ try:
+ msg = yaml.safe_load(json.loads(line))
+ except Exception:
+ logging.error('Invalid input: %s' % line)
+ if msg:
+ self.mainloop.queue_event(self, JsonNewMessage(msg))
def _send_eof(self, event_source, event):
self.mainloop.queue_event(self, JsonEof())