-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-129758: Correct imports in Lib/_pyrepl #129761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ed75139
e3312e0
6a7a07e
afbf3ff
57f20fe
2f97006
7eb0a1c
1444ba1
6679398
83804c9
03174a7
8d5ef46
7ac543f
8e96d24
616405b
7281903
92bb2d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,14 +30,12 @@ | |
import functools | ||
import os | ||
import sys | ||
import code | ||
|
||
from .readline import _get_reader, multiline_input | ||
from .readline import _get_reader, multiline_input, _setup | ||
|
||
TYPE_CHECKING = False | ||
|
||
if TYPE_CHECKING: | ||
from typing import Any | ||
from code import InteractiveConsole | ||
|
||
|
||
_error: tuple[type[Exception], ...] | type[Exception] | ||
|
@@ -83,7 +81,7 @@ def _clear_screen(): | |
} | ||
|
||
|
||
def _more_lines(console: code.InteractiveConsole, unicodetext: str) -> bool: | ||
def _more_lines(console: InteractiveConsole, unicodetext: str) -> bool: | ||
# ooh, look at the hack: | ||
src = _strip_final_indent(unicodetext) | ||
try: | ||
|
@@ -103,11 +101,10 @@ def _more_lines(console: code.InteractiveConsole, unicodetext: str) -> bool: | |
|
||
|
||
def run_multiline_interactive_console( | ||
console: code.InteractiveConsole, | ||
console: InteractiveConsole, | ||
*, | ||
future_flags: int = 0, | ||
) -> None: | ||
from .readline import _setup | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, don't change this line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sobolevn ok, but why? We already have import There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In general, the default position is the status quo, you need to justify every change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed it because it duplicates imports. As I already said it is on line 34 |
||
_setup(console.locals) | ||
if future_flags: | ||
console.compile.compiler.flags |= future_flags | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
|
||
import os | ||
|
||
# types | ||
if False: | ||
TYPE_CHECKING = False | ||
if TYPE_CHECKING: | ||
from typing import IO | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,8 +41,6 @@ | |
|
||
|
||
TYPE_CHECKING = False | ||
|
||
# types | ||
if TYPE_CHECKING: | ||
from typing import IO, Literal, overload | ||
else: | ||
|
Uh oh!
There was an error while loading. Please reload this page.