A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/102254.html below:

PyArg_Parse weirds

PyArg_Parse weirdsRobin Becker robin at jessikat.fsnet.co.uk
Tue Apr 24 13:11:28 EDT 2001
In article <3AE5AD13.2090A47E at letterror.com>, Just van Rossum
<just at letterror.com> writes
>Robin Becker wrote:
>
>> OK I figured out that PyArg_Parse seems to know about an existing error so I 
>needed to
>> clear the existing error condition with PyErr_Clear ie
>> 
>>         else if(PyObject_HasAttrString(value,"red")
>>                         && PyObject_HasAttrString(value,"green")
>>                         && PyObject_HasAttrString(value,"blue")){
>>                 double  r, g, b;
>>                 PyObject *v;
>>                 PyErr_Clear();  /*needed this here else i==0 in pyArg_Parse 
>call*/
>>                 v = PyObject_GetAttrString(value,"red");
>>                 i = PyArg_Parse(v,"d",&r);
>
>Wouldn't it make sense to figure out where the original exception is raised, and
>clear it there? Now it looks like you're possibly masking a real error.
>
>Just
no I was testing for another possible value and when that fails I try a
secondd argument type; I just didn't realise that PyArg_Parse would barf
if an error was already set.
-- 
Robin Becker

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4