@@ -1183,17 +1183,18 @@ public void patch(Env newEnv) {
1183
1183
1184
1184
private void importSiteIfForced () {
1185
1185
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
+ }
1197
1198
}
1198
1199
if (!getOption (PythonOptions .WarnOptions ).isEmpty ()) {
1199
1200
// we must force an import of the warnings module here if warnings were passed
0 commit comments