context: delete unused label field
It's not necessary to store the label in the context type, instead use the corresponding library function to get the current in-memory label container. The device label information is stored in-memory by libfdisk library when creating a context or assigning a device. Avoids possible incosistencies between libfdisk in-memory label and python-libfdisk context type label information.master
parent
a732758f2b
commit
e23d9cd027
|
@ -33,7 +33,6 @@ static PyObject *Context_new(PyTypeObject *type,
|
||||||
|
|
||||||
if (self) {
|
if (self) {
|
||||||
self->cxt = NULL;
|
self->cxt = NULL;
|
||||||
self->lb = NULL;
|
|
||||||
self->tb = NULL;
|
self->tb = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +95,6 @@ static PyObject *Context_assign_device(ContextObject *self, PyObject *args, PyOb
|
||||||
/* XXX: readonly */
|
/* XXX: readonly */
|
||||||
fdisk_assign_device(self->cxt, fname, 1);
|
fdisk_assign_device(self->cxt, fname, 1);
|
||||||
|
|
||||||
self->lb = fdisk_get_label(self->cxt, NULL);
|
|
||||||
fdisk_get_partitions(self->cxt, &self->tb);
|
fdisk_get_partitions(self->cxt, &self->tb);
|
||||||
|
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
|
|
Loading…
Reference in New Issue