]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/python/writer.c
python: Fix setters
[people/ms/libloc.git] / src / python / writer.c
index f8a08387779797be2da62139ef6536b2b5a5624d..6d4ea68586a0ce8cffe6cf50ad4a9e20c849856d 100644 (file)
@@ -51,11 +51,8 @@ static PyObject* Writer_get_vendor(WriterObject* self) {
        return PyUnicode_FromString(vendor);
 }
 
-static int Writer_set_vendor(WriterObject* self, PyObject* args) {
-       const char* vendor = NULL;
-
-       if (!PyArg_ParseTuple(args, "s", &vendor))
-               return -1;
+static int Writer_set_vendor(WriterObject* self, PyObject* value) {
+       const char* vendor = PyUnicode_AsUTF8(value);
 
        int r = loc_writer_set_vendor(self->writer, vendor);
        if (r) {