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
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 37b6a87

Browse files
author
Anselm Kruis
committed
Merge branch main into main-slp
2 parents 247315e + e1179a5 commit 37b6a87

File tree

17 files changed

+76
-44
lines changed

17 files changed

+76
-44
lines changed

‎Doc/library/dis.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,9 +1113,13 @@ All of the following opcodes use their arguments.
11131113

11141114
.. opcode:: RAISE_VARARGS (argc)
11151115

1116-
Raises an exception. *argc* indicates the number of arguments to the raise
1117-
statement, ranging from 0 to 3. The handler will find the traceback as TOS2,
1118-
the parameter as TOS1, and the exception as TOS.
1116+
Raises an exception using one of the 3 forms of the ``raise`` statement,
1117+
depending on the value of *argc*:
1118+
1119+
* 0: ``raise`` (re-raise previous exception)
1120+
* 1: ``raise TOS`` (raise exception instance or type at ``TOS``)
1121+
* 2: ``raise TOS1 from TOS`` (raise exception instance or type at ``TOS1``
1122+
with ``__cause__`` set to ``TOS``)
11191123

11201124

11211125
.. opcode:: CALL_FUNCTION (argc)

‎Doc/library/fileinput.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ The typical use is::
2323

2424
This iterates over the lines of all files listed in ``sys.argv[1:]``, defaulting
2525
to ``sys.stdin`` if the list is empty. If a filename is ``'-'``, it is also
26-
replaced by ``sys.stdin``. To specify an alternative list of filenames, pass it
27-
as the first argument to :func:`.input`. A single file name is also allowed.
26+
replaced by ``sys.stdin`` and the optional arguments *mode* and *openhook*
27+
are ignored. To specify an alternative list of filenames, pass it as the
28+
first argument to :func:`.input`. A single file name is also allowed.
2829

2930
All files are opened in text mode by default, but you can override this by
3031
specifying the *mode* parameter in the call to :func:`.input` or

‎Lib/fileinput.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
99
This iterates over the lines of all files listed in sys.argv[1:],
1010
defaulting to sys.stdin if the list is empty. If a filename is '-' it
11-
is also replaced by sys.stdin. To specify an alternative list of
12-
filenames, pass it as the argument to input(). A single file name is
13-
also allowed.
11+
is also replaced by sys.stdin and the optional arguments mode and
12+
openhook are ignored. To specify an alternative list of filenames,
13+
pass it as the argument to input(). A single file name is also allowed.
1414
1515
Functions filename(), lineno() return the filename and cumulative line
1616
number of the line that has just been read; filelineno() returns its

‎Lib/idlelib/NEWS.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ Released on 2019年10月20日?
33
======================================
44

55

6+
bpo-35610: Replace now redundant editor.context_use_ps1 with
7+
.prompt_last_line. This finishes change started in bpo-31858.
8+
69
bpo-32411: Stop sorting dict created with desired line order.
710

811
bpo-37038: Make idlelib.run runnable; add test clause.

‎Lib/idlelib/editor.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,6 @@ def __init__(self, flist=None, filename=None, key=None, root=None):
228228
self.indentwidth = self.tabwidth
229229
self.set_notabs_indentwidth()
230230

231-
# If context_use_ps1 is true, parsing searches back for a ps1 line;
232-
# else searches for a popular (if, def, ...) Python stmt.
233-
self.context_use_ps1 = False
234-
235231
# When searching backwards for a reliable place to begin parsing,
236232
# first start num_context_lines[0] lines back, then
237233
# num_context_lines[1] lines back if that didn't work, and so on.
@@ -1337,14 +1333,13 @@ def newline_and_indent_event(self, event):
13371333
# open/close first need to find the last stmt
13381334
lno = index2line(text.index('insert'))
13391335
y = pyparse.Parser(self.indentwidth, self.tabwidth)
1340-
if not self.context_use_ps1:
1336+
if not self.prompt_last_line:
13411337
for context in self.num_context_lines:
13421338
startat = max(lno - context, 1)
13431339
startatindex = repr(startat) + ".0"
13441340
rawtext = text.get(startatindex, "insert")
13451341
y.set_code(rawtext)
13461342
bod = y.find_good_parse_start(
1347-
self.context_use_ps1,
13481343
self._build_char_in_string_func(startatindex))
13491344
if bod is not None or startat == 1:
13501345
break

‎Lib/idlelib/hyperparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def index2line(index):
3535
return int(float(index))
3636
lno = index2line(text.index(index))
3737

38-
if not editwin.context_use_ps1:
38+
if not editwin.prompt_last_line:
3939
for context in editwin.num_context_lines:
4040
startat = max(lno - context, 1)
4141
startatindex = repr(startat) + ".0"

‎Lib/idlelib/idle_test/test_autocomplete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __init__(self, root, text):
1919
self.text = text
2020
self.indentwidth = 8
2121
self.tabwidth = 8
22-
self.context_use_ps1 = True
22+
self.prompt_last_line = '>>>'# Currently not used by autocomplete.
2323

2424

2525
class AutoCompleteTest(unittest.TestCase):

‎Lib/idlelib/idle_test/test_hyperparser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def __init__(self, text):
1111
self.text = text
1212
self.indentwidth = 8
1313
self.tabwidth = 8
14-
self.context_use_ps1 = True
14+
self.prompt_last_line = '>>>'
1515
self.num_context_lines = 50, 500, 1000
1616

1717
_build_char_in_string_func = EditorWindow._build_char_in_string_func
@@ -53,7 +53,7 @@ def setUp(self):
5353

5454
def tearDown(self):
5555
self.text.delete('1.0', 'end')
56-
self.editwin.context_use_ps1 = True
56+
self.editwin.prompt_last_line = '>>>'
5757

5858
def get_parser(self, index):
5959
"""
@@ -71,7 +71,7 @@ def test_init(self):
7171
self.assertIn('precedes', str(ve.exception))
7272

7373
# test without ps1
74-
self.editwin.context_use_ps1 = False
74+
self.editwin.prompt_last_line = ''
7575

7676
# number of lines lesser than 50
7777
p = self.get_parser('end')

‎Lib/idlelib/idle_test/test_parenmatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, text):
1717
self.text = text
1818
self.indentwidth = 8
1919
self.tabwidth = 8
20-
self.context_use_ps1 = True
20+
self.prompt_last_line = '>>>'# Currently not used by parenmatch.
2121

2222

2323
class ParenMatchTest(unittest.TestCase):

‎Lib/idlelib/pyshell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ def __init__(self, flist=None):
881881
self.usetabs = True
882882
# indentwidth must be 8 when using tabs. See note in EditorWindow:
883883
self.indentwidth = 8
884-
self.context_use_ps1=True
884+
885885
self.sys_ps1 = sys.ps1 if hasattr(sys, 'ps1') else '>>> '
886886
self.prompt_last_line = self.sys_ps1.split('\n')[-1]
887887
self.prompt = self.sys_ps1 # Changes when debug active

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /