From 71b55cfe0bb47e971e35531d3453865526eafb41 Mon Sep 17 00:00:00 2001 From: Tristan Honscheid Date: Thu, 28 Jan 2021 21:46:36 -0500 Subject: [PATCH] Bug fix in property validation error message #### Issue * `member` is undefined here and triggers an AttributeError, causing user to miss the actual error message. #### Fix * Replace `member` with `prop`. Tested by creating a RW property without a setter and got the correct error message: ``` ValueError: property "MyProp" is writable but does not have a setter ``` --- dbus_next/service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbus_next/service.py b/dbus_next/service.py index 41d77a6..bd3b4c1 100644 --- a/dbus_next/service.py +++ b/dbus_next/service.py @@ -354,7 +354,7 @@ def __init__(self, name: str): # validate that writable properties have a setter for prop in self.__properties: if prop.access.writable() and prop.prop_setter is None: - raise ValueError(f'property "{member.name}" is writable but does not have a setter') + raise ValueError(f'property "{prop.name}" is writable but does not have a setter') def emit_properties_changed(self, changed_properties: Dict[str, Any],