Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: Python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'only,': 0.07; 'used.': 0.07; 'subject:()': 0.09; 'subject:module': 0.09; 'subject:setting': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'subject:error': 0.11; 'value.': 0.15; 'pointer,': 0.16; 'subject: \n ': 0.16; 'subject:exception': 0.16; 'subject:through': 0.16; 'integer': 0.17; 'pointer': 0.17; 'thanks,': 0.18; 'written': 0.20; 'supposed': 0.21; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; "doesn't": 0.28; 'usually': 0.30; 'error': 0.30; 'url:python': 0.32; 'null': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'but': 0.36; 'url:org': 0.36; 'should': 0.36; 'received:209': 0.37; 'received:209.85.216': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'where': 0.40; 'link': 0.60; 'success': 0.63; 'saw': 0.75; '"most': 0.84; 'indicator': 0.91 Newsgroups: comp.lang.python Date: Thu, 2 Aug 2012 02:21:28 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=122.248.161.59; posting-account=xyzyTgoAAAB2OaRT58zhH9j7aeiDRJa3 References: User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 122.248.161.59 MIME-Version: 1.0 Subject: Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString() From: rahul To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1343899291 news.xs4all.nl 6959 [2001:888:2000:d::a6]:46810 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26387 Hi TJG, The above link also doesn't strictly said that return value should be NULL = only, it only said that usually NULL pointer used. No where I saw that it i= s nessasory t At http://docs.python.org/c-api/exceptions.html. it is written that "Most f= unctions also return an error indicator, usually NULL if they are supposed = to return a pointer, or -1 if they return an integer (exception: the PyArg_= *() functions return 1 for success and 0 for failure)." this also told that= usually NULL is used but we can change the return error indicator to any v= alue. As like PyArg_*() used 0 for error value. Thanks, Rahul