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

fix script_container attribute access #1275

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open

Conversation

ixje
Copy link
Member

@ixje ixje commented Aug 24, 2024

Related issue
fix #1273

Summary or solution description
script_container is the only module attribute of the interop package that returns a class with more properties. The module analyser is changed to allow to capture the class properties.

In the case of importing the runtime module and trying to do

x = runtime.script_container.hash

The code generator failed to generate code for getting the script_container and only generated code for picking the hash property. It now recursively generates for all attributes instead of just the first as the AST looks as follows

                Assign(
                    targets=[
                        Name(id='x', ctx=Store())],
                    value=Attribute(
                        value=Attribute(
                            value=Name(id='runtime', ctx=Load()),
                            attr='script_container',
                            ctx=Load()),
                        attr='hash',
                        ctx=Load())),

@ixje ixje changed the title Script container fix script_container attribute access Aug 24, 2024
@coveralls
Copy link
Collaborator

Coverage Status

coverage: 91.206% (-0.002%) from 91.208%
when pulling 7263874 on script_container
into f304688 on development.

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 this pull request may close these issues.

2 participants