Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

semver.VersionInfo allows negative numbers #291

Copy link
Copy link
Closed
@tomschr

Description

@tomschr
Issue body actions

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 resultsError, flaw or fault to produce incorrect or unexpected resultsRelease_2.x.yOnly for the major release 2Only for the major release 2Release_3.x.yOnly for the major release 3Only 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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.