Skip to content

Commit ac3c18c

Browse files
committed
Add module type
1 parent 51885f2 commit ac3c18c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vm/src/pyobject.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ pub struct PyContext {
6262
pub tuple_type: PyObjectRef,
6363
pub str_type: PyObjectRef,
6464
pub function_type: PyObjectRef,
65+
pub module_type: PyObjectRef,
6566
pub bound_method_type: PyObjectRef,
6667
pub member_descriptor_type: PyObjectRef,
6768
pub object: PyObjectRef,
@@ -111,6 +112,7 @@ impl PyContext {
111112
objobject::create_object(type_type.clone(), object_type.clone(), dict_type.clone());
112113
objdict::create_type(type_type.clone(), object_type.clone(), dict_type.clone());
113114

115+
let module_type = create_type("module", &type_type, &object_type, &dict_type);
114116
let function_type = create_type("function", &type_type, &object_type, &dict_type);
115117
let bound_method_type = create_type("method", &type_type, &object_type, &dict_type);
116118
let member_descriptor_type =
@@ -145,6 +147,7 @@ impl PyContext {
145147
str_type: str_type,
146148
object: object_type,
147149
function_type: function_type,
150+
module_type: module_type,
148151
bound_method_type: bound_method_type,
149152
member_descriptor_type: member_descriptor_type,
150153
type_type: type_type,
@@ -284,7 +287,7 @@ impl PyContext {
284287
name: name.clone(),
285288
dict: scope.clone(),
286289
},
287-
self.type_type(),
290+
self.module_type.clone(),
288291
)
289292
}
290293

0 commit comments

Comments
 (0)