<div>Making Python perform the redirect seems to work:</div>
<div>
<p>command = "python -c \"import sys; sys.stderr = sys.stdout; import non_existent; print 'asdf'\"" ;<br />output = [ SHELL $(command) : strip-eol ] ;<br />echo ------------------------ ;<br />echo $(output) ;<br />echo ------------------------ ;<br />exit : 0 ;</p>
<p>Which will output the following:</p>
<p>------------------------<br />Traceback (most recent call last):<br /> File "&lt;string&gt;", line 1, in &lt;module&gt;<br />ImportError: No module named non_existent<br />------------------------</p>
<p>That's about the best I could come up with at the moment.</p>
<p>It would probably be cleaner, though, to just create a script and do all of your setup/checking in there and just call out to that script to perform the configuration.</p>
</div>

