En Wed, 13 Jun 2007 12:03:00 -0300, Robert Bauck Hamar
<[EMAIL PROTECTED]> escribió:
> Allen wrote:
>
>> I use try catch, but cannot catch the execeptions of execution python
>> method.
>
> No. CPython is written in C, not C++, and C has no concept of exceptions.
> Exceptions in Python is usuall
Allen wrote:
> I use try catch, but cannot catch the execeptions of execution python
> method.
>
> PYCALL_API void PyCall(const char * pszModule, const char * pszFunc,
> void * pArg)
> {
> if (pszModule == NULL || pszFunc == NULL)
> {
> return;
> }
>
> Py_Initialize();
>
> PyObject * pModule =
One way is to create an intermediate python function, which returns a
special value when an exception is caught.
def ExceptionCatcher(FunctionToCall):
def F():
try: FunctionToCall()
except: return -1
return 0
return F
Then instead of calling your function, you woul
I use try catch, but cannot catch the execeptions of execution python
method.
PYCALL_API void PyCall(const char * pszModule, const char * pszFunc,
void * pArg)
{
if (pszModule == NULL || pszFunc == NULL)
{
return;
}
Py_Initialize();
PyObjec