Skip to content

Commit 737832e

Browse files
committed
update to python 3.10.11
1 parent a6fe84e commit 737832e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+478
-384
lines changed

PythonLib/full/argparse.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,18 @@ def _format_actions_usage(self, actions, groups):
400400
except ValueError:
401401
continue
402402
else:
403-
end = start + len(group._group_actions)
403+
group_action_count = len(group._group_actions)
404+
end = start + group_action_count
404405
if actions[start:end] == group._group_actions:
406+
407+
suppressed_actions_count = 0
405408
for action in group._group_actions:
406409
group_actions.add(action)
410+
if action.help is SUPPRESS:
411+
suppressed_actions_count += 1
412+
413+
exposed_actions_count = group_action_count - suppressed_actions_count
414+
407415
if not group.required:
408416
if start in inserts:
409417
inserts[start] += ' ['
@@ -413,7 +421,7 @@ def _format_actions_usage(self, actions, groups):
413421
inserts[end] += ']'
414422
else:
415423
inserts[end] = ']'
416-
else:
424+
elif exposed_actions_count > 1:
417425
if start in inserts:
418426
inserts[start] += ' ('
419427
else:
@@ -487,7 +495,6 @@ def _format_actions_usage(self, actions, groups):
487495
text = _re.sub(r'(%s) ' % open, r'\1', text)
488496
text = _re.sub(r' (%s)' % close, r'\1', text)
489497
text = _re.sub(r'%s *%s' % (open, close), r'', text)
490-
text = _re.sub(r'\(([^|]*)\)', r'\1', text)
491498
text = text.strip()
492499

493500
# return the text

PythonLib/full/asyncio/streams.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -627,16 +627,17 @@ async def readuntil(self, separator=b'\n'):
627627
async def read(self, n=-1):
628628
"""Read up to `n` bytes from the stream.
629629
630-
If n is not provided, or set to -1, read until EOF and return all read
631-
bytes. If the EOF was received and the internal buffer is empty, return
632-
an empty bytes object.
630+
If `n` is not provided or set to -1,
631+
read until EOF, then return all read bytes.
632+
If EOF was received and the internal buffer is empty,
633+
return an empty bytes object.
633634
634-
If n is zero, return empty bytes object immediately.
635+
If `n` is 0, return an empty bytes object immediately.
635636
636-
If n is positive, this function try to read `n` bytes, and may return
637-
less or equal bytes than requested, but at least one byte. If EOF was
638-
received before any byte is read, this function returns empty byte
639-
object.
637+
If `n` is positive, return at most `n` available bytes
638+
as soon as at least 1 byte is available in the internal buffer.
639+
If EOF is received before any byte is read, return an empty
640+
bytes object.
640641
641642
Returned value is not limited with limit, configured at stream
642643
creation.

PythonLib/full/bdb.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,10 @@ def format_stack_entry(self, frame_lineno, lprefix=': '):
570570
rv = frame.f_locals['__return__']
571571
s += '->'
572572
s += reprlib.repr(rv)
573-
line = linecache.getline(filename, lineno, frame.f_globals)
574-
if line:
575-
s += lprefix + line.strip()
573+
if lineno is not None:
574+
line = linecache.getline(filename, lineno, frame.f_globals)
575+
if line:
576+
s += lprefix + line.strip()
576577
return s
577578

578579
# The following methods can be called by clients to use

PythonLib/full/concurrent/futures/process.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ def run(self):
337337
if self.is_shutting_down():
338338
self.flag_executor_shutting_down()
339339

340+
# When only canceled futures remain in pending_work_items, our
341+
# next call to wait_result_broken_or_wakeup would hang forever.
342+
# This makes sure we have some running futures or none at all.
343+
self.add_call_item_to_queue()
344+
340345
# Since no new work items can be added, it is safe to shutdown
341346
# this thread if there are no pending work items.
342347
if not self.pending_work_items:

PythonLib/full/dataclasses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ def fields(class_or_instance):
11951195
try:
11961196
fields = getattr(class_or_instance, _FIELDS)
11971197
except AttributeError:
1198-
raise TypeError('must be called with a dataclass type or instance')
1198+
raise TypeError('must be called with a dataclass type or instance') from None
11991199

12001200
# Exclude pseudo-fields. Note that fields is sorted by insertion
12011201
# order, so the order of the tuple is as the fields were defined.

PythonLib/full/ensurepip/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
__all__ = ["version", "bootstrap"]
1313
_PACKAGE_NAMES = ('setuptools', 'pip')
1414
_SETUPTOOLS_VERSION = "65.5.0"
15-
_PIP_VERSION = "22.3.1"
15+
_PIP_VERSION = "23.0.1"
1616
_PROJECTS = [
1717
("setuptools", _SETUPTOOLS_VERSION, "py3"),
1818
("pip", _PIP_VERSION, "py3"),

PythonLib/full/ensurepip/_bundled/pip-22.3.1-py3-none-any.whl renamed to PythonLib/full/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl

1.96 MB
Binary file not shown.

PythonLib/full/fileinput.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def isstdin(self):
419419

420420

421421
def hook_compressed(filename, mode, *, encoding=None, errors=None):
422-
if encoding is None: # EncodingWarning is emitted in FileInput() already.
422+
if encoding is None and "b" not in mode: # EncodingWarning is emitted in FileInput() already.
423423
encoding = "locale"
424424
ext = os.path.splitext(filename)[1]
425425
if ext == '.gz':

PythonLib/full/html/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def escape(s, quote=True):
2525
return s
2626

2727

28-
# see http://www.w3.org/TR/html5/syntax.html#tokenizing-character-references
28+
# see https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
2929

3030
_invalid_charrefs = {
3131
0x00: '\ufffd', # REPLACEMENT CHARACTER

PythonLib/full/http/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ def isclosed(self):
448448
return self.fp is None
449449

450450
def read(self, amt=None):
451+
"""Read and return the response body, or up to the next amt bytes."""
451452
if self.fp is None:
452453
return b""
453454

0 commit comments

Comments
 (0)