summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--context.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/context.c b/context.c
index 94a9fe7..805a2b7 100644
--- a/context.c
+++ b/context.c
@@ -296,8 +296,14 @@ static PyGetSetDef Context_getseters[] = {
static PyObject *Context_repr(ContextObject *self)
{
- return PyUnicode_FromFormat("<libfdisk.Context object at %p, details=%s, readonly=%s>",
+ PyObject *lbo = Py_None;
+
+ if (fdisk_has_label(self->cxt))
+ lbo = PyObjectResultLabel(fdisk_get_label(self->cxt, NULL));
+
+ return PyUnicode_FromFormat("<libfdisk.Context object at %p, label=%R, details=%s, readonly=%s>",
self,
+ lbo,
fdisk_is_details(self->cxt) ? "True" : "False",
fdisk_is_readonly(self->cxt) ? "True" : "False");
}