Skip to content

Incorrect exception handling in utils/spm_docs.py ? #2690

Closed
@kchawla-pi

Description

@kchawla-pi

In nipype/utils/spm_docs.py, the function _strip_header() has the code:

    try:
        index = doc.index(hdr)
        ...
    except KeyError as e:
        raise_from(IOError('This docstring was not generated by Nipype!\n'), e)

However, doc doesn't seem to be a dict type so KeyError wouldn't apply here.
If hdr is not found in doc, that would raise a ValueError, which is not caught by the code here.

This was the error I got

    index = doc.index(hdr)
ValueError: substring not found

Ubuntu 18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions