]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/python/as.c
python: Fix setters
[people/ms/libloc.git] / src / python / as.c
index 3b2864871f04917442255fa9e9e71ec2126ded5a..ec1573b26bb8039f03dd967583f64e53d8a697f4 100644 (file)
@@ -80,11 +80,8 @@ static PyObject* AS_get_name(ASObject* self) {
        return PyUnicode_FromString(name);
 }
 
-static int AS_set_name(ASObject* self, PyObject* args) {
-       const char* name = NULL;
-
-       if (!PyArg_ParseTuple(args, "s", &name))
-               return -1;
+static int AS_set_name(ASObject* self, PyObject* value) {
+       const char* name = PyUnicode_AsUTF8(value);
 
        int r = loc_as_set_name(self->as, name);
        if (r) {