I was debugging some of our own code in an interactive Python shell, and ran into a runtime type error with the @actor decorator:
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
The error is caused by this line, which fails with locally defined, non module-bound functions:
|
self.logger = get_logger(fn.__module__, actor_name) |
It's definitely an edge case, but this simple change fixes it:
self.logger = get_logger(fn.__module__ or '_', actor_name)
I was debugging some of our own code in an interactive Python shell, and ran into a runtime type error with the
@actordecorator:The error is caused by this line, which fails with locally defined, non module-bound functions:
dramatiq/dramatiq/actor.py
Line 70 in 6d60a5f
It's definitely an edge case, but this simple change fixes it: