Browse Source

fix json_encode with python console

283
ThomasV 9 years ago
parent
commit
55fafc35c1
  1. 3
      gui/qt/console.py

3
gui/qt/console.py

@ -213,10 +213,9 @@ class Console(QtGui.QPlainTextEdit):
try: try:
# eval is generally considered bad practice. use it wisely! # eval is generally considered bad practice. use it wisely!
result = eval(command, self.namespace, self.namespace) result = eval(command, self.namespace, self.namespace)
result = util.json_encode(result)
if result != None: if result != None:
if self.is_json: if self.is_json:
util.print_msg(result) util.print_msg(util.json_encode(result))
else: else:
self.appendPlainText(repr(result)) self.appendPlainText(repr(result))
except SyntaxError: except SyntaxError:

Loading…
Cancel
Save