mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-128636: Fix crash in PyREPL when os.environ is overwritten with an invalid value for macOS (GH-138089)
Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
parent
46f823bb81
commit
8ef7735c53
5 changed files with 33 additions and 9 deletions
|
|
@ -2898,7 +2898,7 @@ def force_color(color: bool):
|
|||
from .os_helper import EnvironmentVarGuard
|
||||
|
||||
with (
|
||||
swap_attr(_colorize, "can_colorize", lambda file=None: color),
|
||||
swap_attr(_colorize, "can_colorize", lambda *, file=None: color),
|
||||
EnvironmentVarGuard() as env,
|
||||
):
|
||||
env.unset("FORCE_COLOR", "NO_COLOR", "PYTHON_COLORS")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue