385,9 → 385,7 |
Calling all code in one command: |
ia = code.InteractiveInterpreter() ia.runsource(getval()) |
works fine in plain Python. Not here. WTF? */ |
cm += ( |
"try:\n" |
" import cStringIO\n" |
cm += ("import cStringIO\n" |
" scribus._bu = cStringIO.StringIO()\n" |
" sys.stdout = scribus._bu\n" |
" sys.stderr = scribus._bu\n" |
396,12 → 394,7 |
" scribus._ia.push(i)\n" |
" scribus.retval(scribus._bu.getvalue())\n" |
" sys.stdout = sys.__stdout__\n" |
" sys.stderr = sys.__stderr__\n" |
"except SystemExit:\n" |
" print 'Catched SystemExit - it is not good for Scribus'\n" |
"except KeyboardInterrupt:\n" |
" print 'Catched KeyboardInterrupt - it is not good for Scribus'\n" |
); |
"sys.stderr = sys.__stderr__\n"); |
} |
// Set up sys.argv |
/* PV - WARNING: THIS IS EVIL! This code summons a crash - see |
431,9 → 424,6 |
"command you entered. Details were printed to " |
"stderr. ") + "</qt>"); |
} |
else |
// Because 'result' may be NULL, not a PyObject*, we must call PyXDECREF not Py_DECREF |
Py_XDECREF(result); |
} |
ScCore->primaryMainWindow()->ScriptRunning = false; |
} |