Skip to content

Commit ce735ae

Browse files
committed
update to python 3.10.6
1 parent a4ebde6 commit ce735ae

File tree

114 files changed

+984
-487
lines changed

Some content is hidden

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

114 files changed

+984
-487
lines changed

PythonLib/full/asyncio/futures.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def result(self):
198198
raise exceptions.InvalidStateError('Result is not ready.')
199199
self.__log_traceback = False
200200
if self._exception is not None:
201-
raise self._exception
201+
raise self._exception.with_traceback(self._exception_tb)
202202
return self._result
203203

204204
def exception(self):
@@ -274,6 +274,7 @@ def set_exception(self, exception):
274274
raise TypeError("StopIteration interacts badly with generators "
275275
"and cannot be raised into a Future")
276276
self._exception = exception
277+
self._exception_tb = exception.__traceback__
277278
self._state = _FINISHED
278279
self.__schedule_callbacks()
279280
self.__log_traceback = True

PythonLib/full/asyncio/proactor_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def close(self):
113113
def __del__(self, _warn=warnings.warn):
114114
if self._sock is not None:
115115
_warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
116-
self.close()
116+
self._sock.close()
117117

118118
def _fatal_error(self, exc, message='Fatal error on pipe transport'):
119119
try:

PythonLib/full/concurrent/futures/_base.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,18 @@ def wait(fs, timeout=None, return_when=ALL_COMPLETED):
312312
done.update(waiter.finished_futures)
313313
return DoneAndNotDoneFutures(done, fs - done)
314314

315+
316+
def _result_or_cancel(fut, timeout=None):
317+
try:
318+
try:
319+
return fut.result(timeout)
320+
finally:
321+
fut.cancel()
322+
finally:
323+
# Break a reference cycle with the exception in self._exception
324+
del fut
325+
326+
315327
class Future(object):
316328
"""Represents the result of an asynchronous computation."""
317329

@@ -606,9 +618,9 @@ def result_iterator():
606618
while fs:
607619
# Careful not to keep a reference to the popped future
608620
if timeout is None:
609-
yield fs.pop().result()
621+
yield _result_or_cancel(fs.pop())
610622
else:
611-
yield fs.pop().result(end_time - time.monotonic())
623+
yield _result_or_cancel(fs.pop(), end_time - time.monotonic())
612624
finally:
613625
for future in fs:
614626
future.cancel()

PythonLib/full/copy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def _keep_alive(x, memo):
258258

259259
def _reconstruct(x, memo, func, args,
260260
state=None, listiter=None, dictiter=None,
261-
deepcopy=deepcopy):
261+
*, deepcopy=deepcopy):
262262
deep = memo is not None
263263
if deep and args:
264264
args = (deepcopy(arg, memo) for arg in args)

PythonLib/full/email/_parseaddr.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ def _parsedate_tz(data):
9595
return None
9696
data = data[:5]
9797
[dd, mm, yy, tm, tz] = data
98+
if not (dd and mm and yy):
99+
return None
98100
mm = mm.lower()
99101
if mm not in _monthnames:
100102
dd, mm = mm, dd.lower()
@@ -110,6 +112,8 @@ def _parsedate_tz(data):
110112
yy, tm = tm, yy
111113
if yy[-1] == ',':
112114
yy = yy[:-1]
115+
if not yy:
116+
return None
113117
if not yy[0].isdigit():
114118
yy, tz = tz, yy
115119
if tm[-1] == ',':

PythonLib/full/ensurepip/__init__.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
__all__ = ["version", "bootstrap"]
1313
_PACKAGE_NAMES = ('setuptools', 'pip')
14-
_SETUPTOOLS_VERSION = "58.1.0"
15-
_PIP_VERSION = "22.0.4"
14+
_SETUPTOOLS_VERSION = "63.2.0"
15+
_PIP_VERSION = "22.2.1"
1616
_PROJECTS = [
1717
("setuptools", _SETUPTOOLS_VERSION, "py3"),
1818
("pip", _PIP_VERSION, "py3"),
@@ -90,8 +90,18 @@ def _run_pip(args, additional_paths=None):
9090
sys.argv[1:] = {args}
9191
runpy.run_module("pip", run_name="__main__", alter_sys=True)
9292
"""
93-
return subprocess.run([sys.executable, '-W', 'ignore::DeprecationWarning',
94-
"-c", code], check=True).returncode
93+
94+
cmd = [
95+
sys.executable,
96+
'-W',
97+
'ignore::DeprecationWarning',
98+
'-c',
99+
code,
100+
]
101+
if sys.flags.isolated:
102+
# run code in isolated mode if currently running isolated
103+
cmd.insert(1, '-I')
104+
return subprocess.run(cmd, check=True).returncode
95105

96106

97107
def version():
-2.03 MB
Binary file not shown.
1.95 MB
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)