Skip to content

Runtime error when using @actor decorator in interactive shell with a locally defined function #694

@bartvanandel

Description

@bartvanandel

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions