diff --exclude=.svn --exclude=CVS -Naur gst-python/gst/gstpad.override gst-python-mod/gst/gstpad.override
--- gst-python/gst/gstpad.override	2006-07-03 11:31:26.000000000 +0200
+++ gst-python-mod/gst/gstpad.override	2006-10-21 01:28:56.000000000 +0200
@@ -1042,12 +1042,16 @@
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GstPad.set_caps", kwlist, &py_caps))
         return NULL;
-    caps = pygst_caps_from_pyobject (py_caps, NULL);
-    if (PyErr_Occurred())
-      return NULL;
+    if (py_caps == Py_None) {
+	caps = NULL;
+    } else {
+	caps = pygst_caps_from_pyobject (py_caps, NULL);
+	if (PyErr_Occurred())
+	    return NULL;
+    }
     pyg_begin_allow_threads;
     ret = gst_pad_set_caps(GST_PAD(self->obj), caps);
-    if (ret)
+    if (ret && caps)
 	gst_caps_unref (caps);
     pyg_end_allow_threads;
     return PyBool_FromLong(ret);
