File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1267,6 +1267,16 @@ init_interp_main(PyThreadState *tstate)
1267
1267
// This is also needed when the JIT is enabled
1268
1268
#ifdef _Py_TIER2
1269
1269
if (is_main_interp ) {
1270
+ int enabled = 1 ;
1271
+ #if _Py_TIER2 & 2
1272
+ enabled = 0 ;
1273
+ #endif
1274
+ char * env = Py_GETENV ("PYTHON_JIT" );
1275
+ if (env && * env != '\0' ) {
1276
+ // PYTHON_JIT=0|1 overrides the default
1277
+ enabled = * env != '0' ;
1278
+ }
1279
+ if (enabled ) {
1270
1280
PyObject * opt = PyUnstable_Optimizer_NewUOpOptimizer ();
1271
1281
if (opt == NULL ) {
1272
1282
return _PyStatus_ERR ("can't initialize optimizer" );
@@ -1275,6 +1285,7 @@ init_interp_main(PyThreadState *tstate)
1275
1285
return _PyStatus_ERR ("can't install optimizer" );
1276
1286
}
1277
1287
Py_DECREF (opt );
1288
+ }
1278
1289
}
1279
1290
#endif
1280
1291
2A7A
You can’t perform that action at this time.
0 commit comments