Message106306
Hi all,
I found a bug in the exception handler. When I
start the app without any arguments I get an
output I expect:
__main__:2:DeprecationWarning: Deprecated function.
When I run the app with arguments, the arguments
are printed somehow in the exception output:
-test=HALLO:1:DeprecationWarning: Deprecated function
Can anyone please confirm?
Bye, Seb
[code]
#include "Python/Python.h"
static PyObject *testfunc(PyObject *self, PyObject *args, PyObject *keywords)
{
PyErr_Warn(PyExc_DeprecationWarning, "Deprecated function.");
Py_RETURN_NONE;
}
static PyMethodDef testmod[] =
{
{"testfunc", (PyCFunction)testfunc, METH_NOARGS, "Prints out a text to stdout."},
{NULL}
};
int main (int argc, char **argv)
{
Py_Initialize();
PySys_SetArgv(argc, argv);
PyObject *mod = Py_InitModule4("testmod", testmod, "", NULL, PYTHON_API_VERSION);
if(mod == NULL) return -1;
PyRun_SimpleString( "import testmod\n"
"testmod.testfunc()");
Py_Finalize();
return 0;
}
[/code] |
|
Date |
User |
Action |
Args |
2010-05-22 14:00:32 | Sebastian | set | recipients:
+ Sebastian |
2010-05-22 14:00:32 | Sebastian | set | messageid: <1274536832.39.0.220188636264.issue8787@psf.upfronthosting.co.za> |
2010-05-22 14:00:30 | Sebastian | link | issue8787 messages |
2010-05-22 14:00:30 | Sebastian | create | |
|