Skip to content

Commit c7bc218

Browse files
committed
Merge branch 'main' into gh-125451-test_processes_terminate
2 parents b1f599b + aac89b5 commit c7bc218

28 files changed

Lines changed: 196 additions & 65 deletions

Doc/library/argparse.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,8 @@ FileType objects
18081808
Argument groups
18091809
^^^^^^^^^^^^^^^
18101810

1811-
.. method:: ArgumentParser.add_argument_group(title=None, description=None)
1811+
.. method:: ArgumentParser.add_argument_group(title=None, description=None, *, \
1812+
[argument_default], [conflict_handler])
18121813

18131814
By default, :class:`ArgumentParser` groups command-line arguments into
18141815
"positional arguments" and "options" when displaying help
@@ -1853,6 +1854,11 @@ Argument groups
18531854

18541855
--bar BAR bar help
18551856

1857+
The optional, keyword-only parameters argument_default_ and conflict_handler_
1858+
allow for finer-grained control of the behavior of the argument group. These
1859+
parameters have the same meaning as in the :class:`ArgumentParser` constructor,
1860+
but apply specifically to the argument group rather than the entire parser.
1861+
18561862
Note that any arguments not in your user-defined groups will end up back
18571863
in the usual "positional arguments" and "optional arguments" sections.
18581864

InternalDocs/compiler.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ Important files
515515
Creates C structs corresponding to the ASDL types. Also contains code for
516516
marshalling AST nodes (core ASDL types have marshalling code in
517517
[Python/asdl.c](https://github.com/python/cpython/blob/main/Python/asdl.c)).
518-
"File automatically generated by
518+
File automatically generated by
519519
[Parser/asdl_c.py](https://github.com/python/cpython/blob/main/Parser/asdl_c.py).
520520
This file must be committed separately after every grammar change
521521
is committed since the ``__version__`` value is set to the latest
@@ -572,7 +572,7 @@ Important files
572572
* [Include/internal/pycore_ast.h](https://github.com/python/cpython/blob/main/Include/internal/pycore_ast.h)
573573
: Contains the actual definitions of the C structs as generated by
574574
[Python/Python-ast.c](https://github.com/python/cpython/blob/main/Python/Python-ast.c)
575-
"Automatically generated by
575+
Automatically generated by
576576
[Parser/asdl_c.py](https://github.com/python/cpython/blob/main/Parser/asdl_c.py).
577577

578578
* [Include/internal/pycore_asdl.h](https://github.com/python/cpython/blob/main/Include/internal/pycore_asdl.h)

Lib/pdb.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,7 @@ def user_call(self, frame, argument_list):
429429
def user_line(self, frame):
430430
"""This function is called when we stop or break at this line."""
431431
if self._wait_for_mainpyfile:
432-
if (self.mainpyfile != self.canonic(frame.f_code.co_filename)
433-
or frame.f_lineno <= 0):
432+
if (self.mainpyfile != self.canonic(frame.f_code.co_filename)):
434433
return
435434
self._wait_for_mainpyfile = False
436435
self.bp_commands(frame)

Lib/test/test_cmd_line_script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def test_pep_409_verbiage(self):
543543
script = textwrap.dedent("""\
544544
try:
545545
raise ValueError
546-
except:
546+
except ValueError:
547547
raise NameError from None
548548
""")
549549
with os_helper.temp_dir() as script_dir:

Lib/test/test_concurrent_futures/test_shutdown.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ def test_cancel_futures_wait_false(self):
253253

254254

255255
class ProcessPoolShutdownTest(ExecutorShutdownTest):
256+
# gh-125451: 'lock' cannot be serialized, the test is broken
257+
# and hangs randomly
258+
@unittest.skipIf(True, "broken test")
256259
def test_processes_terminate(self):
257260
def acquire_lock(lock):
258261
lock.acquire()

Lib/test/test_coroutines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ async def f():
11851185
async def g():
11861186
try:
11871187
raise KeyError
1188-
except:
1188+
except KeyError:
11891189
return await f()
11901190

11911191
_, result = run_async(g())

Lib/test/test_ctypes/test_libc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_sqrt(self):
2323
self.assertEqual(lib.my_sqrt(2.0), math.sqrt(2.0))
2424

2525
@unittest.skipUnless(hasattr(ctypes, "c_double_complex"),
26-
"requires C11 complex type")
26+
"requires C11 complex type and libffi >= 3.3.0")
2727
def test_csqrt(self):
2828
lib.my_csqrt.argtypes = ctypes.c_double_complex,
2929
lib.my_csqrt.restype = ctypes.c_double_complex

Lib/test/test_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def testMethods(self):
126126
# it must also return None if an exception was given
127127
try:
128128
1/0
129-
except:
129+
except ZeroDivisionError:
130130
self.assertEqual(self.f.__exit__(*sys.exc_info()), None)
131131

132132
def testReadWhenWriting(self):

Lib/test/test_listcomps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ def test_comp_in_try_except(self):
609609
result = snapshot = None
610610
try:
611611
result = [{func}(value) for value in value]
612-
except:
612+
except ValueError:
613613
snapshot = value
614614
raise
615615
"""
@@ -643,7 +643,7 @@ def test_exception_in_post_comp_call(self):
643643
value = [1, None]
644644
try:
645645
[v for v in value].sort()
646-
except:
646+
except TypeError:
647647
pass
648648
"""
649649
self._check_in_scopes(code, {"value": [1, None]})

Lib/test/test_logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4877,7 +4877,7 @@ def test_formatting(self):
48774877
r.addHandler(h)
48784878
try:
48794879
raise RuntimeError('deliberate mistake')
4880-
except:
4880+
except RuntimeError:
48814881
logging.exception('failed', stack_info=True)
48824882
r.removeHandler(h)
48834883
h.close()

0 commit comments

Comments
 (0)