How to trap syntax error signal
<p>I'm creating a python framework it run a set of scripts. Each script would load some common code that performs general system initialization and logging. However, I'd like to catch and process an event when a particular script has a syntax error. Yes, it is possible to use </p>

<pre><code>except SyntaxError:
</code></pre>

<p>But then every script will have to have this code in it. 
Is there any way to make this common? Catching a signal would work, I just don't know which signal would indicate a syntax error.</p>

<p>The scripts are run just as any other Python scripts:</p>

<pre><code>test_script.py -l log_file.txt
</code></pre>

<p>Much appreciated.</p>
