diff --git a/projects/PyZpc/pyzfx.cpp b/projects/PyZpc/pyzfx.cpp index fd98b29f1..19ed144ef 100644 --- a/projects/PyZpc/pyzfx.cpp +++ b/projects/PyZpc/pyzfx.cpp @@ -189,8 +189,8 @@ struct PyZfx : INode { if (PyDict_SetItemString(zenoModDict, "_args", argsDict) < 0) throw makeError("failed to set zpy._args"); - if (has_input("code")) { // path.empty() - auto code = get_input2("code"); + auto code = get_input2("code"); + if (!code.empty()) { // path.empty() auto tmpFile = zs::abs_exe_directory() + "/__pyzfx__zstmp.py"; if (std::FILE* f = std::fopen(tmpFile.c_str(), "w")) { std::fwrite(code.data(), sizeof(char), code.size(), f);