Thanks to visit codestin.com
Credit goes to github.com

Skip to content

semver.VersionInfo allows negative numbers #291

Closed
@tomschr

Description

@tomschr

Situation

If you pass negative numbers into semver.VersionInfo it doesn't raise any errors:

>>> import semver
>>> semver.VersionInfo(-2)                                                                                                                           
VersionInfo(major=-2, minor=0, patch=0, prerelease=None, build=None)

Tested with latest 2.11.0

Proposal

I guess, this shouldn't happen. We should raise a ValueError exception.
Would integrate that into a 2.12.0 release and into the upcoming 3.0.0-alpha0.

@tlaferriere Thomas, can you conform? Do you agree?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugError, flaw or fault to produce incorrect or unexpected resultsRelease_2.x.yOnly for the major release 2Release_3.x.yOnly for the major release 3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions