Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #26387

Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString()

Newsgroups comp.lang.python
Date 2012-08-02 02:21 -0700
References <fa944ed7-8101-4b2f-a49a-363eb8d05d1d@googlegroups.com> <mailman.2856.1343898392.4697.python-list@python.org>
Subject Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString()
From rahul <rahul03535@gmail.com>
Message-ID <mailman.2858.1343899291.4697.python-list@python.org> (permalink)

Show all headers | View raw


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 is nessasory t

At http://docs.python.org/c-api/exceptions.html. it is written that "Most functions 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 value. As like PyArg_*() used 0 for error value.

Thanks,
Rahul

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

C extension module doesn't throw exception after setting error indicator through PyErr_SetString() rahul <rahul03535@gmail.com> - 2012-08-02 01:57 -0700
  Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString() Tim Golden <mail@timgolden.me.uk> - 2012-08-02 10:06 +0100
    Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString() rahul <rahul03535@gmail.com> - 2012-08-02 02:21 -0700
    Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString() rahul <rahul03535@gmail.com> - 2012-08-02 02:21 -0700
      Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString() Tim Golden <mail@timgolden.me.uk> - 2012-08-02 10:37 +0100
        Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString() rahul <rahul03535@gmail.com> - 2012-08-02 02:50 -0700
          Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString() Tim Golden <mail@timgolden.me.uk> - 2012-08-02 11:45 +0100
          Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString() Stefan Behnel <stefan_ml@behnel.de> - 2012-08-02 12:54 +0200
        Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString() rahul <rahul03535@gmail.com> - 2012-08-02 02:50 -0700

csiph-web