diff --git a/psycopg/lobject_int.c b/psycopg/lobject_int.c index 2f78e90b..43f2b179 100644 --- a/psycopg/lobject_int.c +++ b/psycopg/lobject_int.c @@ -253,7 +253,7 @@ lobject_close_locked(lobjectObject *self, char **error) return 0; break; default: - PyErr_SetString(OperationalError, "the connection is broken"); + *error = strdup("the connection is broken"); return -1; break; }