Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect alpha, beta and rc versions of Python #142

Closed
Carreau opened this issue Jun 30, 2020 · 1 comment · Fixed by #143
Closed

Detect alpha, beta and rc versions of Python #142

Carreau opened this issue Jun 30, 2020 · 1 comment · Fixed by #143

Comments

@Carreau
Copy link
Contributor

Carreau commented Jun 30, 2020

In [1]: from parso.utils import parse_version_string

In [2]: parse_version_string('3.10.0a0')

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-2-70c767a0d0a3> in <module>
----> 1 parse_version_string('3.10.0a0')

~/dev/parso/parso/utils.py in parse_version_string(version)
    183         raise TypeError('version must be a string like "3.8"')
    184
--> 185     return _parse_version(version)

~/dev/parso/parso/utils.py in _parse_version(version)
    132     match = re.match(r'(\d+)(?:\.(\d{1,2})(?:\.\d+)?)?$', version)
    133     if match is None:
--> 134         raise ValueError('The given version is not in the right format. '
    135                          'Use something like "3.8" or "3".')
    136

ValueError: The given version is not in the right format. Use something like "3.8" or "3".
@Carreau
Copy link
Contributor Author

Carreau commented Jun 30, 2020

see gvanrossum/patma#117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant