@@ -1183,17 +1183,18 @@ public void patch(Env newEnv) {
11831183
11841184 private void importSiteIfForced () {
11851185 PythonModule siteModule ;
1186- if (getOption (PythonOptions .ForceImportSite ) &&
1187- getOption (PythonOptions .PythonPath ).isEmpty () &&
1188- (siteModule = ImpModuleBuiltins .importFrozenModuleObject (this , "graalpython.site" , true )) != null ) {
1189- // assume we can use the frozen site module
1190- // TODO: rename graalpython.site again to just site when we upgrade to Python 3.10+
1191- // or newer and remove this hack
1192- PyDictSetItem .getUncached ().execute (null , getSysModules (), "site" , siteModule );
1193- LOGGER .log (Level .FINE , () -> "import 'site' # <frozen>" );
1194- } else {
1195- CallTarget site = env .parsePublic (FORCE_IMPORTS_SOURCE );
1196- site .call ();
1186+ if (getOption (PythonOptions .ForceImportSite )) {
1187+ if (getOption (PythonOptions .PythonPath ).isEmpty () &&
1188+ (siteModule = ImpModuleBuiltins .importFrozenModuleObject (this , "graalpython.site" , true )) != null ) {
1189+ // assume we can use the frozen site module
1190+ // TODO: rename graalpython.site again to just site when we upgrade to Python 3.10+
1191+ // or newer and remove this hack
1192+ PyDictSetItem .getUncached ().execute (null , getSysModules (), "site" , siteModule );
1193+ LOGGER .log (Level .FINE , () -> "import 'site' # <frozen>" );
1194+ } else {
1195+ CallTarget site = env .parsePublic (FORCE_IMPORTS_SOURCE );
1196+ site .call ();
1197+ }
11971198 }
11981199 if (!getOption (PythonOptions .WarnOptions ).isEmpty ()) {
11991200 // we must force an import of the warnings module here if warnings were passed
0 commit comments