mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-23 04:50:17 +00:00
...
This commit is contained in:
parent
08d6a9a1ea
commit
66301591a2
10
src/vm.h
10
src/vm.h
@ -556,11 +556,6 @@ public:
|
||||
|
||||
Temp(VM* vm, StrName name, int type): vm(vm), name(name){
|
||||
ImportContext* ctx = &vm->_import_context;
|
||||
for(auto& [k,v]: ctx->pending){
|
||||
if(k == name){
|
||||
vm->_error("ImportError", fmt("circular import ", name.escape()));
|
||||
}
|
||||
}
|
||||
ctx->pending.emplace_back(name, type);
|
||||
}
|
||||
|
||||
@ -596,6 +591,11 @@ public:
|
||||
type = 0;
|
||||
filename = fmt(name, ".py");
|
||||
}
|
||||
for(auto& [k, v]: _import_context.pending){
|
||||
if(k == name){
|
||||
vm->_error("ImportError", fmt("circular import ", name.escape()));
|
||||
}
|
||||
}
|
||||
PyObject* ext_mod = _modules.try_get(name);
|
||||
if(ext_mod == nullptr){
|
||||
Str source;
|
||||
|
Loading…
x
Reference in New Issue
Block a user