Fix a python module resolving bug

This commit is contained in:
Shunsuke Shibayama 2022-12-14 06:37:43 +09:00
parent 3c17518963
commit 954c6f752d
4 changed files with 41 additions and 36 deletions

View file

@ -65,8 +65,13 @@ pub fn module(path: TyParam) -> Type {
}
#[inline]
pub fn py_module(path: TyParam) -> Type {
poly("PyModule", vec![path])
pub fn py_module(path: TyParam, py_comp_mode: bool) -> Type {
let name = if py_comp_mode {
"ModuleType"
} else {
"PyModule"
};
poly(name, vec![path])
}
pub fn module_from_path<P: Into<PathBuf>>(path: P) -> Type {