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

Some code is optimized out completely #11

Open
KOLANICH opened this issue Dec 2, 2022 · 0 comments
Open

Some code is optimized out completely #11

KOLANICH opened this issue Dec 2, 2022 · 0 comments

Comments

@KOLANICH
Copy link
Contributor

KOLANICH commented Dec 2, 2022

# source: pypa/setuptools, copyright their, license: MIT
import ast
m = ast.parse("""
import setuptools

if __name__ == '__main__':
    here and os.chdir(here)
    dist = setuptools.setup(**setup_params)
""")

import peval
from peval.highlevelapi import _run_components
import astor
r, v = _run_components(m, {})
print(astor.to_source(r, indent_with='\t',), v)

results in

import setuptools
if __name__ == '__main__':
	here and os.chdir(here)

and the dict is {}

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

1 participant