[issue11060] distutils2 sdist does not complain about version that is not PEP 386 compliant

Éric Araujo report at bugs.python.org
Sat Feb 19 22:50:43 CET 2011


Éric Araujo <merwok at netwok.org> added the comment:

You don’t need a new function (and certainly not in the __init__ submodule, the right place would be the version module), just do something like this:

try:
    NormalizedVersion(text)
except IrrationalVersionError:
    # version is invalid

Alternative: use suggest_normalized_version, which returns a string or None, then display according text to prompt the user to accept the suggested version or type another.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11060>
_______________________________________


More information about the Python-bugs-list mailing list