Skip to content

Can't import * from python modules #207

Closed
@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Anonymous

<%namespace module="myapp.blah" import="*"/>

seems to do dir(myapp.blah), which picks up everything in that module (variables, imported modules), not just functions. It then dies on "util.partial(callable_, ...)" because callable_ isn't callable.

I've hackily fixed it myself in runtime.py:610, not sure if this is a good fix or not:

- if k[0] != '_':
+ if k[0] != '_' and callable(getattr(self.module, k)):

I also tried getting it to look at module.all rather than dir(), but that didn't import anything at all for some reason.

having a good fix upstream would be appreciated :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions