Skip to content

Cannot import submodules within an Entrypointed function #441

@wllgrnt

Description

@wllgrnt

Test:

from typed_python import Entrypoint
@Entrypoint
def f(x):
    import os.path
    return os.path.basename(x)

print(f('test/test2/test3.py'))

Expected behaviour

prints 'test3.py'

Actual behaviour

Error thrown by importlib - AttributeError: 'list' object has no attribute 'startswith' (the importlib call is from _convert_statement_ast in function_conversion_context.py)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions