summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/src/extensions.rst2
-rw-r--r--psycopg/notify_type.c2
-rwxr-xr-xtests/test_notify.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/doc/src/extensions.rst b/doc/src/extensions.rst
index 5561ea4..970d4b9 100644
--- a/doc/src/extensions.rst
+++ b/doc/src/extensions.rst
@@ -106,7 +106,7 @@ functionalities defined by the |DBAPI|_.
Close the object and remove it from the database.
-.. autoclass:: Notify(pid, channel, payload=None)
+.. autoclass:: Notify(pid, channel, payload='')
:members: pid, channel, payload
.. versionadded:: 2.2.3
diff --git a/psycopg/notify_type.c b/psycopg/notify_type.c
index 2e3a1e1..a104f21 100644
--- a/psycopg/notify_type.c
+++ b/psycopg/notify_type.c
@@ -82,7 +82,7 @@ notify_init(NotifyObject *self, PyObject *args, PyObject *kwargs)
}
if (!payload) {
- payload = Py_None;
+ payload = PyString_FromStringAndSize("", 0);
}
Py_CLEAR(self->pid);
diff --git a/tests/test_notify.py b/tests/test_notify.py
index 957b371..7dc45d9 100755
--- a/tests/test_notify.py
+++ b/tests/test_notify.py
@@ -143,7 +143,7 @@ conn.close()
n = psycopg2.extensions.Notify(10, 'foo')
self.assertEqual(10, n.pid)
self.assertEqual('foo', n.channel)
- self.assertEqual(None, n.payload)
+ self.assertEqual('', n.payload)
(pid, channel) = n
self.assertEqual((pid, channel), (10, 'foo'))