diff --git a/dramatiq/generic.py b/dramatiq/generic.py index d993ee5b..6ad79e90 100644 --- a/dramatiq/generic.py +++ b/dramatiq/generic.py @@ -40,9 +40,9 @@ def __new__(metacls, name, bases, attrs): return clazz def __getattr__(cls, name): - if '__actor__' not in cls.__dict__: + if "__actor__" not in cls.__dict__: # avoid infinite recursion on GenericActor - raise AttributeError(f"type object '{cls.__name__}' has no attribute '{name}'") + raise AttributeError(f"type object {cls.__name__!r} has no attribute {name!r}") return getattr(cls.__actor__, name) diff --git a/tests/test_generic_actors.py b/tests/test_generic_actors.py index f35a81a6..cca25fd4 100644 --- a/tests/test_generic_actors.py +++ b/tests/test_generic_actors.py @@ -121,4 +121,4 @@ def perform(self): def test_getattr_generic_actor(): with pytest.raises(AttributeError): - dramatiq.GenericActor.missing_property \ No newline at end of file + dramatiq.GenericActor.missing_property