On Tue, Apr 21, 2009 at 11:50 PM, Robert Bradshaw <[email protected]> wrote: >> >>> It would be good to have it behave more like python -m >>> http://trac.cython.org/cython_trac/ticket/291 >> >> Mmm... I´m not sure python -m will be equivalent to your embeding... >> Py_Main() does a lot of things other thanInitialize() && SetArgv(), I >> do not remember right now, but IIRC some environ vars are inspected in >> Py_Main() > > Hmm... I'd like to see a list of what happens before we decide to opt > for python -m semantics or simplicity. I'm going to leave the ticket > open for now. >
Perhaps I was not clear enough... I mean, 'python -m' is one thing, a binary executable embedding Python is a different beast... You are adding support for generating a bin exe, so IMHO you should keep it SIMPLE, at least for now... >> >> In short, I would check for SystemExit and honor its return code, or >> just return "-1" > > Interestingly enough, the C-API call PyErr_PrintEx does this for you. > (Yeah, I might call it a bit hackish, but that's what Python seems to > use). > Wow... I see... So you call PyErr_PrintEx(0) (likely passing 1 will be pointless, right?) and you are done. -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
