Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc3643a1

Browse files
authored
gh-118817: Fixasyncio REPL on Windows (#118819)
1 parent35b5eaa commitc3643a1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

‎Lib/asyncio/__main__.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def run(self):
108108
try:
109109
importreadline# NoQA
110110
exceptImportError:
111-
pass
111+
readline=None
112112

113113
interactive_hook=getattr(sys,"__interactivehook__",None)
114114

@@ -122,8 +122,9 @@ def run(self):
122122
except:
123123
pass
124124
else:
125-
completer=rlcompleter.Completer(console.locals)
126-
readline.set_completer(completer.complete)
125+
ifreadlineisnotNone:
126+
completer=rlcompleter.Completer(console.locals)
127+
readline.set_completer(completer.complete)
127128

128129
repl_thread=REPLThread()
129130
repl_thread.daemon=True

‎Lib/test/test_repl.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
fromtextwrapimportdedent
88
fromtestimportsupport
99
fromtest.supportimportcpython_only,has_subprocess_support,SuppressCrashReport
10-
fromtest.support.script_helperimportkill_python
10+
fromtest.support.script_helperimportkill_python,assert_python_ok
1111
fromtest.support.import_helperimportimport_module
1212

1313

@@ -195,6 +195,9 @@ def bar(x):
195195
expected="(30, None, [\'def foo(x):\\n\',\' return x + 1\\n\',\'\\n\'],\'<stdin>\')"
196196
self.assertIn(expected,output,expected)
197197

198+
deftest_asyncio_repl_is_ok(self):
199+
assert_python_ok("-m","asyncio")
200+
198201

199202

200203
classTestInteractiveModeSyntaxErrors(unittest.TestCase):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp