Skip to content

Some code is optimized out completely #11

Description

@KOLANICH
# 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 {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions