diff options
author | Baruch Sterin <baruchs@gmail.com> | 2011-01-13 22:11:37 +0200 |
---|---|---|
committer | Baruch Sterin <baruchs@gmail.com> | 2011-01-13 22:11:37 +0200 |
commit | c85a763444f696e0125445b5adc675020d736c5d (patch) | |
tree | 03d28593a06c5549949e35106939589ef05cb853 /src/base/main | |
parent | f4066b5be3b5473f5c64ab71d1983df6ca7aec76 (diff) | |
download | abc-c85a763444f696e0125445b5adc675020d736c5d.tar.gz abc-c85a763444f696e0125445b5adc675020d736c5d.tar.bz2 abc-c85a763444f696e0125445b5adc675020d736c5d.zip |
pyabc: make the SIGINT signal handler clean up by sending SIGINT to child processes registered by the python code. Also provide functions to block SIGINT and unblock it, to allow for critical sections where signals are blocked
Diffstat (limited to 'src/base/main')
-rw-r--r-- | src/base/main/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/base/main/main.c b/src/base/main/main.c index 42ea255d..0b6294c4 100644 --- a/src/base/main/main.c +++ b/src/base/main/main.c @@ -90,7 +90,14 @@ int Abc_RealMain( int argc, char * argv[] ) init_pyabc(); pModule = PyImport_ImportModule("pyabc"); - Py_DECREF(pModule); + if (pModule) + { + Py_DECREF(pModule); + } + else + { + fprintf( pAbc->Err, "error: pyabc.py not found. PYTHONPATH may not be set properly.\n"); + } } #endif /* ABC_PYTHON_EMBED */ |