Skip to content

Unhelpful error messages from BoutOutputs #48

Description

@johnomotani

If an error happens in BoutOutputs.__init__() before self._parallel is defined, the exception message gets hidden behind one from __del__() saying AttributeError: 'BoutOutputs' object has no attribute '_parallel'. What's the 'correct' way to fix this? We could move self._parallel = parallel to the first line of __init__() and I guess that would fix this issue here, but it feels kludgy and non-general. Does anyone know of a nicer pattern?

For example, this happened in boutproject/BOUT-dev#2335 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions