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

Unable to parse stub conditionals #28

Closed
tharvik opened this issue Jul 15, 2016 · 1 comment
Closed

Unable to parse stub conditionals #28

tharvik opened this issue Jul 15, 2016 · 1 comment

Comments

@tharvik
Copy link

tharvik commented Jul 15, 2016

In PEP 484, there is a section on conditional stubs.

For example, the next code is a valid stub code

import sys

if sys.version_info <= (3,):
    def old_code_stub() -> None: ...

But currently, running pytd on it will fail with

Error while parsing pyi:

  File "/tmp/asd.py", line 3
    if sys.version_info <= (3,):
          ^
SyntaxError: Unexpected 'DOT'

Found while doing typeshed#345.

@matthiaskramm
Copy link
Contributor

Fixed.

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

No branches or pull requests

2 participants