Skip to content

version information regex: adjust  #7

@jgehrcke

Description

@jgehrcke

https://www.flake8rules.com/rules/W605.html

As of Python 3.6, a backslash-character pair that is not a valid escape sequence now generates a DeprecationWarning. This will eventually become a SyntaxError.

better:

version = re.search(
    r'^__version__\s*=\s*"(.*)"', open("...").read(), re.M
).group(1)

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