void (@NotNull TargetEnvironmentRequest targetEnvironmentRequest) { var module = getModule(); Module[] modules; if (module != null) { // Use module if provided modules = new Module[1]; modules[0] = module; } else { // Use all modules otherwise modules = ModuleManager.getInstance(myProject).getModules(); } PythonScripts.ensureProjectSdkAndModuleDirsAreOnTarget(targetEnvironmentRequest, myProject, modules); }