Skip to content

Commit

Permalink
Add unset TERM= to the "dumb" terminal ignore as well
Browse files Browse the repository at this point in the history
  • Loading branch information
ambv committed Sep 25, 2024
1 parent c79a4c4 commit b9c71ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Lib/_pyrepl/simple_interact.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import _sitebuiltins
import linecache
import functools
import os
import sys
import code

Expand All @@ -50,7 +51,6 @@ def check() -> str:
try:
_get_reader()
except _error as e:
import os # temporary debugging measure to understand the Address sanitizer environment failure
if term := os.environ.get("TERM", ""):
term = f"; TERM={term}"
return str(str(e) or repr(e) or "unknown error") + term
Expand Down
4 changes: 3 additions & 1 deletion Lib/test/test_pyrepl/test_pyrepl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,7 @@ def test_bracketed_paste_single_line(self):
output = multiline_input(reader)
self.assertEqual(output, input_code)


@skipUnless(pty, "requires pty")
class TestDumbTerminal(ReplTestCase):
def test_dumb_terminal_exits_cleanly(self):
Expand All @@ -1065,8 +1066,9 @@ def test_dumb_terminal_exits_cleanly(self):
self.assertNotIn("Exception", output)
self.assertNotIn("Traceback", output)


@skipUnless(pty, "requires pty")
@skipIf(os.environ.get("TERM") == "dumb", "can't use pyrepl in dumb terminal")
@skipIf((os.environ.get("TERM") or "dumb") == "dumb", "can't use pyrepl in dumb terminal")
class TestMain(ReplTestCase):
def setUp(self):
# Cleanup from PYTHON* variables to isolate from local
Expand Down

0 comments on commit b9c71ef

Please sign in to comment.