Skip to content

Commit 15b759d

Browse files
committed
fix
1 parent 6e5bb6f commit 15b759d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Python/pystate.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,13 @@ is_env_enabled(const char *env_name)
522522
return env && *env != '\0' && *env != '0';
523523
}
524524

525+
static inline bool
526+
is_env_disabled(const char *env_name)
527+
{
528+
char *env = Py_GETENV(env_name);
529+
return env != NULL && *env == '0';
530+
}
531+
525532
static inline void
526533
init_policy(uint16_t *target, const char *env_name, uint16_t default_value,
527534
long min_value, long max_value)
@@ -619,7 +626,7 @@ init_interpreter(PyInterpreterState *interp,
619626
SIDE_EXIT_INITIAL_BACKOFF, 0, MAX_BACKOFF);
620627

621628
interp->opt_config.specialization_enabled = !is_env_enabled("PYTHON_SPECIALIZATION_OFF");
622-
interp->opt_config.uops_optimize_enabled = is_env_enabled("PYTHON_UOPS_OPTIMIZE");
629+
interp->opt_config.uops_optimize_enabled = !is_env_disabled("PYTHON_UOPS_OPTIMIZE");
623630
if (interp != &runtime->_main_interpreter) {
624631
/* Fix the self-referential, statically initialized fields. */
625632
interp->dtoa = (struct _dtoa_state)_dtoa_state_INIT(interp);

0 commit comments

Comments
 (0)