From 59642b96db63c33c0c19ab0ea3185de855f706bb Mon Sep 17 00:00:00 2001 From: "mhammond%skippinet.com.au" Date: Thu, 13 Oct 2005 01:34:00 +0000 Subject: [PATCH] GetVariantValue is a much better name than UnwrapVariant. git-svn-id: svn://10.0.0.236/branches/DOM_AGNOSTIC_BRANCH@182145 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/extensions/python/xpcom/src/module/_xpcom.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mozilla/extensions/python/xpcom/src/module/_xpcom.cpp b/mozilla/extensions/python/xpcom/src/module/_xpcom.cpp index 029a5d4bde3..3269768cc9b 100644 --- a/mozilla/extensions/python/xpcom/src/module/_xpcom.cpp +++ b/mozilla/extensions/python/xpcom/src/module/_xpcom.cpp @@ -390,10 +390,10 @@ PyXPCOMMethod_MakeVariant(PyObject *self, PyObject *args) } static PyObject * -PyXPCOMMethod_UnwrapVariant(PyObject *self, PyObject *args) +PyXPCOMMethod_GetVariantValue(PyObject *self, PyObject *args) { PyObject *ob, *obParent = NULL; - if (!PyArg_ParseTuple(args, "O|O:MakeVariant", &ob, &obParent)) + if (!PyArg_ParseTuple(args, "O|O:GetVariantValue", &ob, &obParent)) return NULL; nsCOMPtr var; @@ -406,7 +406,7 @@ PyXPCOMMethod_UnwrapVariant(PyObject *self, PyObject *args) ob->ob_type->tp_name); Py_nsISupports *parent = nsnull; - if (obParent) { + if (obParent && obParent != Py_None) { if (!Py_nsISupports::Check(obParent)) { PyErr_SetString(PyExc_ValueError, "Object not an nsISupports wrapper"); @@ -482,7 +482,7 @@ static struct PyMethodDef xpcom_methods[]= {"AllocateBuffer", AllocateBuffer, 1}, {"LogConsoleMessage", LogConsoleMessage, 1, "Write a message to the xpcom console service"}, {"MakeVariant", PyXPCOMMethod_MakeVariant, 1}, - {"UnwrapVariant", PyXPCOMMethod_UnwrapVariant, 1}, + {"GetVariantValue", PyXPCOMMethod_GetVariantValue, 1}, // These should no longer be used - just use the logging.getLogger('pyxpcom')... { NULL } };