FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 03-20-2009, 03:42 AM
David Lehman
 
Default If we have no error string, place None in the tuple.

On Thu, 2009-03-19 at 18:17 -1000, David Cantrell wrote:
> Be more defensive about what we get back from the _isys module. Do
> not assume we get an error string. If it's empty, place None in the
> tuple.

Ack.

> ---
> isys/isys.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/isys/isys.c b/isys/isys.c
> index 0813e50..65ee688 100644
> --- a/isys/isys.c
> +++ b/isys/isys.c
> @@ -291,7 +291,14 @@ static PyObject * doMount(PyObject * s, PyObject * args) {
> PyObject *tuple = PyTuple_New(2);
>
> PyTuple_SetItem(tuple, 0, PyInt_FromLong(rc));
> - PyTuple_SetItem(tuple, 1, PyString_FromString(err));
> +
> + if (err == NULL) {
> + Py_INCREF(Py_None);
> + PyTuple_SetItem(tuple, 1, Py_None);
> + } else {
> + PyTuple_SetItem(tuple, 1, PyString_FromString(err));
> + }
> +
> PyErr_SetObject(PyExc_SystemError, tuple);
> }
>

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-20-2009, 03:57 AM
David Cantrell
 
Default If we have no error string, place None in the tuple.

On 03/19/2009 06:42 PM, David Lehman wrote:

On Thu, 2009-03-19 at 18:17 -1000, David Cantrell wrote:

Be more defensive about what we get back from the _isys module. Do
not assume we get an error string. If it's empty, place None in the
tuple.


Ack.


Applied and pushed, thanks.




---
isys/isys.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/isys/isys.c b/isys/isys.c
index 0813e50..65ee688 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -291,7 +291,14 @@ static PyObject * doMount(PyObject * s, PyObject * args) {
PyObject *tuple = PyTuple_New(2);

PyTuple_SetItem(tuple, 0, PyInt_FromLong(rc));
- PyTuple_SetItem(tuple, 1, PyString_FromString(err));
+
+ if (err == NULL) {
+ Py_INCREF(Py_None);
+ PyTuple_SetItem(tuple, 1, Py_None);
+ } else {
+ PyTuple_SetItem(tuple, 1, PyString_FromString(err));
+ }
+
PyErr_SetObject(PyExc_SystemError, tuple);
}



_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list



--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:20 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org