Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix mypy
  • Loading branch information
pablogsal committed Jun 11, 2024
commit d8760e87f69b34c36dbbbddd824d53c3c58ea208
8 changes: 7 additions & 1 deletion Lib/_pyrepl/simple_interact.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
from .console import InteractiveColoredConsole
from .readline import _get_reader, multiline_input

TYPE_CHECKING = False

if TYPE_CHECKING:
from typing import Any


_error: tuple[type[Exception], ...] | type[Exception]
try:
from .unix_console import _error
Expand Down Expand Up @@ -74,7 +80,7 @@ def _clear_screen():
"clear": _clear_screen,
}

DEFAULT_NAMESPACE = {
DEFAULT_NAMESPACE: dict[str, Any] = {
'__name__': '__main__',
'__doc__': None,
'__package__': None,
Expand Down
4 changes: 4 additions & 0 deletions Lib/test/test_pyrepl/test_pyrepl.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,10 @@ def test_exposed_globals_in_repl(self):
'["__annotations__", "__builtins__", "__doc__", "__loader__", '
'"__name__", "__package__", "__spec__"]'
)

with patch('_pyrepl.simple_interact.


output, exit_code = self.run_repl(["sorted(dir())", "exit"])
self.assertEqual(exit_code, 0)
output = output.replace("\'", '"')
Comment thread
lysnikolaou marked this conversation as resolved.
Outdated
Expand Down