Skip to content

Commit a483193

Browse files
committed
Merge remote-tracking branch 'upstream/main' into jit/gc
2 parents 26c577d + c865ab3 commit a483193

File tree

22 files changed

+534
-181
lines changed

22 files changed

+534
-181
lines changed

Doc/deprecations/pending-removal-in-3.20.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Pending removal in Python 3.20
99
- :mod:`csv`
1010
- :mod:`!ctypes.macholib`
1111
- :mod:`decimal` (use :data:`decimal.SPEC_VERSION` instead)
12+
- :mod:`http.server`
1213
- :mod:`imaplib`
1314
- :mod:`ipaddress`
1415
- :mod:`json`

Doc/library/functions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,16 +606,16 @@ are always available. They are listed here in alphabetical order.
606606
This function executes arbitrary code. Calling it with
607607
user-supplied input may lead to security vulnerabilities.
608608

609-
The *expression* argument is parsed and evaluated as a Python expression
609+
The *source* argument is parsed and evaluated as a Python expression
610610
(technically speaking, a condition list) using the *globals* and *locals*
611611
mappings as global and local namespace. If the *globals* dictionary is
612612
present and does not contain a value for the key ``__builtins__``, a
613613
reference to the dictionary of the built-in module :mod:`builtins` is
614-
inserted under that key before *expression* is parsed. That way you can
614+
inserted under that key before *source* is parsed. That way you can
615615
control what builtins are available to the executed code by inserting your
616616
own ``__builtins__`` dictionary into *globals* before passing it to
617617
:func:`eval`. If the *locals* mapping is omitted it defaults to the
618-
*globals* dictionary. If both mappings are omitted, the expression is
618+
*globals* dictionary. If both mappings are omitted, the source is
619619
executed with the *globals* and *locals* in the environment where
620620
:func:`eval` is called. Note, *eval()* will only have access to the
621621
:term:`nested scopes <nested scope>` (non-locals) in the enclosing

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,7 @@ New deprecations
10261026
- :mod:`csv`
10271027
- :mod:`!ctypes.macholib`
10281028
- :mod:`decimal` (use :data:`decimal.SPEC_VERSION` instead)
1029+
- :mod:`http.server`
10291030
- :mod:`imaplib`
10301031
- :mod:`ipaddress`
10311032
- :mod:`json`

Include/internal/pycore_opcode_metadata.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_pyatomic_ft_wrappers.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ extern "C" {
5757
_Py_atomic_store_uintptr_release(&value, new_value)
5858
#define FT_ATOMIC_STORE_SSIZE_RELAXED(value, new_value) \
5959
_Py_atomic_store_ssize_relaxed(&value, new_value)
60+
#define FT_ATOMIC_STORE_SSIZE_RELEASE(value, new_value) \
61+
_Py_atomic_store_ssize_release(&value, new_value)
6062
#define FT_ATOMIC_STORE_UINT8_RELAXED(value, new_value) \
6163
_Py_atomic_store_uint8_relaxed(&value, new_value)
6264
#define FT_ATOMIC_STORE_UINT16_RELAXED(value, new_value) \
@@ -140,6 +142,7 @@ extern "C" {
140142
#define FT_ATOMIC_STORE_PTR_RELEASE(value, new_value) value = new_value
141143
#define FT_ATOMIC_STORE_UINTPTR_RELEASE(value, new_value) value = new_value
142144
#define FT_ATOMIC_STORE_SSIZE_RELAXED(value, new_value) value = new_value
145+
#define FT_ATOMIC_STORE_SSIZE_RELEASE(value, new_value) value = new_value
143146
#define FT_ATOMIC_STORE_UINT8_RELAXED(value, new_value) value = new_value
144147
#define FT_ATOMIC_STORE_UINT16_RELAXED(value, new_value) value = new_value
145148
#define FT_ATOMIC_STORE_UINT32_RELAXED(value, new_value) value = new_value

Include/internal/pycore_uop_ids.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_metadata.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/http/server.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
# (Actually, the latter is only true if you know the server configuration
6262
# at the time the request was made!)
6363

64-
__version__ = "0.6"
65-
6664
__all__ = [
6765
"HTTPServer", "ThreadingHTTPServer",
6866
"HTTPSServer", "ThreadingHTTPSServer",
@@ -280,7 +278,7 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
280278
# The server software version. You may want to override this.
281279
# The format is multiple whitespace-separated strings,
282280
# where each string is of the form name[/version].
283-
server_version = "BaseHTTP/" + __version__
281+
server_version = "BaseHTTP"
284282

285283
error_message_format = DEFAULT_ERROR_MESSAGE
286284
error_content_type = DEFAULT_ERROR_CONTENT_TYPE
@@ -690,7 +688,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
690688
691689
"""
692690

693-
server_version = "SimpleHTTP/" + __version__
691+
server_version = "SimpleHTTP"
694692
index_pages = ("index.html", "index.htm")
695693
extensions_map = _encodings_map_default = {
696694
'.gz': 'application/gzip',
@@ -1080,5 +1078,14 @@ class HTTPSDualStackServer(DualStackServerMixin, ThreadingHTTPSServer):
10801078
)
10811079

10821080

1081+
def __getattr__(name):
1082+
if name == "__version__":
1083+
from warnings import _deprecated
1084+
1085+
_deprecated("__version__", remove=(3, 20))
1086+
return "0.6" # Do not change
1087+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
1088+
1089+
10831090
if __name__ == '__main__':
10841091
_main()

Lib/profiling/sampling/cli.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,20 @@ class CustomFormatter(
4141

4242
_HELP_DESCRIPTION = """Sample a process's stack frames and generate profiling data.
4343
44-
Commands:
45-
run Run and profile a script or module
46-
attach Attach to and profile a running process
47-
4844
Examples:
4945
# Run and profile a script
50-
python -m profiling.sampling run script.py arg1 arg2
46+
`python -m profiling.sampling run script.py arg1 arg2`
5147
5248
# Attach to a running process
53-
python -m profiling.sampling attach 1234
49+
`python -m profiling.sampling attach 1234`
5450
5551
# Live interactive mode for a script
56-
python -m profiling.sampling run --live script.py
52+
`python -m profiling.sampling run --live script.py`
5753
5854
# Live interactive mode for a running process
59-
python -m profiling.sampling attach --live 1234
55+
`python -m profiling.sampling attach --live 1234`
6056
61-
Use 'python -m profiling.sampling <command> --help' for command-specific help."""
57+
Use `python -m profiling.sampling <command> --help` for command-specific help."""
6258

6359

6460
# Constants for socket synchronization
@@ -506,19 +502,19 @@ def main():
506502
507503
Examples:
508504
# Run and profile a module
509-
python -m profiling.sampling run -m mymodule arg1 arg2
505+
`python -m profiling.sampling run -m mymodule arg1 arg2`
510506
511507
# Generate flamegraph from a script
512-
python -m profiling.sampling run --flamegraph -o output.html script.py
508+
`python -m profiling.sampling run --flamegraph -o output.html script.py`
513509
514510
# Profile with custom interval and duration
515-
python -m profiling.sampling run -i 50 -d 30 script.py
511+
`python -m profiling.sampling run -i 50 -d 30 script.py`
516512
517513
# Save collapsed stacks to file
518-
python -m profiling.sampling run --collapsed -o stacks.txt script.py
514+
`python -m profiling.sampling run --collapsed -o stacks.txt script.py`
519515
520516
# Live interactive mode for a script
521-
python -m profiling.sampling run --live script.py""",
517+
`python -m profiling.sampling run --live script.py`""",
522518
)
523519
run_parser.add_argument(
524520
"-m",
@@ -554,10 +550,10 @@ def main():
554550
555551
Examples:
556552
# Profile all threads, sort by total time
557-
python -m profiling.sampling attach -a --sort tottime 1234
553+
`python -m profiling.sampling attach -a --sort tottime 1234`
558554
559555
# Live interactive mode for a running process
560-
python -m profiling.sampling attach --live 1234""",
556+
`python -m profiling.sampling attach --live 1234`""",
561557
)
562558
attach_parser.add_argument(
563559
"pid",

Lib/test/test_capi/test_opt.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,8 +1938,7 @@ def testfunc(n):
19381938
self.assertIsNotNone(ex)
19391939
uops = get_opnames(ex)
19401940
self.assertIn("_CALL_TUPLE_1", uops)
1941-
# Re-enable later gh-134584
1942-
# self.assertIn("_POP_TOP_NOP", uops)
1941+
self.assertIn("_POP_TOP_NOP", uops)
19431942

19441943
def test_call_str_1(self):
19451944
def testfunc(n):

0 commit comments

Comments
 (0)