Skip to content

Py3's raise ... from ... syntax not supported in Py2 #86

@edschofield

Description

@edschofield

On Python 3 (only), the raise ... from ... syntax can be used as follows:

class DatabaseError(Exception):
    pass

class FileDatabase:
    def __init__(self, filename):
        try:
            self.file = open(filename)
        except IOError as exc:
            raise DatabaseError('failed to open') from exc

(see PEP 3134). This ticket is a feature request for an equivalent mechanism to be provided as e.g. future.utils.raise_from().

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions