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 platform conditionals #29

Closed
tharvik opened this issue Jul 26, 2016 · 2 comments
Closed

Unable to parse stub platform conditionals #29

tharvik opened this issue Jul 26, 2016 · 2 comments

Comments

@tharvik
Copy link

tharvik commented Jul 26, 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.platform == 'win32':
    def windows_def_only() -> None: ...

But currently, running pytd on it will fail with

Error while parsing pyi:
  File "/tmp/asd.pyi", line 3
    if sys.platform == 'win32':
                        ^
SyntaxError: Unexpected 'NAME'
This was referenced Jul 26, 2016
@matthiaskramm
Copy link
Contributor

Fixed in our local version. We're exporting the fix now.

@matthiaskramm
Copy link
Contributor

Fix pushed.

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