diff --git a/Sources/Plasma/Apps/plPythonPack/main.cpp b/Sources/Plasma/Apps/plPythonPack/main.cpp index 83e084d8d7..4aa402f571 100644 --- a/Sources/Plasma/Apps/plPythonPack/main.cpp +++ b/Sources/Plasma/Apps/plPythonPack/main.cpp @@ -49,10 +49,18 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include #include +#include static const char* kPackFileName = "python.pak"; static const char* kModuleFile = "__init__.py"; +/** Directories that should not generate their own .pak file. */ +static const std::unordered_set s_ignoreSubdirs{ + ST_LITERAL("plasma"), + ST_LITERAL("system"), + ST_LITERAL("__pycache__"), +}; + #if HS_BUILD_FOR_WIN32 #define NULL_DEVICE "NUL:" #else @@ -216,7 +224,7 @@ void FindSubDirs(std::vector &dirnames, const plFileName &path) std::vector subdirs = plFileSystem::ListSubdirs(path); for (auto iter = subdirs.begin(); iter != subdirs.end(); ++iter) { ST::string name = iter->GetFileName(); - if (name.compare_i("system") != 0 && name.compare_i("plasma") != 0) + if (s_ignoreSubdirs.find(name) == s_ignoreSubdirs.end()) dirnames.push_back(name); } }