This commit is contained in:
BLUELOVETH 2023-06-01 00:43:24 +08:00
parent 857eec66f1
commit c1abf1b492
5 changed files with 9 additions and 3 deletions

View File

@ -46,7 +46,7 @@ int main(int argc, char** argv){
std::filesystem::current_path(filepath.parent_path());
pkpy::PyObject* ret = nullptr;
ret = vm->exec(src.c_str(), argv_1, pkpy::EXEC_MODE);
ret = vm->exec(src.c_str(), filepath.filename().string(), pkpy::EXEC_MODE);
pkpy_delete(vm);
return ret != nullptr ? 0 : 1;
}

View File

@ -1,3 +1,3 @@
import test
import test1
assert test.add(1, 2) == 13
assert test1.add(1, 2) == 13

1
tests/test1/__init__.py Normal file
View File

@ -0,0 +1 @@
from ._a import add

4
tests/test1/_a.py Normal file
View File

@ -0,0 +1,4 @@
from ._b import C
def add(a, b):
return a + b + C

1
tests/test1/_b.py Normal file
View File

@ -0,0 +1 @@
from test2 import D as C