Skip to content

Test fixes for 3.15 #133599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Include/internal/pycore_magic_number.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,9 @@ Known values:
Python 3.14a7 3622 (Store annotations in different class dict keys)
Python 3.14a7 3623 (Add BUILD_INTERPOLATION & BUILD_TEMPLATE opcodes)
Python 3.14b1 3624 (Don't optimize LOAD_FAST when local is killed by DELETE_FAST)
Python 3.15a0 3650 (Initial version)

Python 3.15 will start with 3650
Python 3.16 will start with 3700

Please don't copy-paste the same pre-release tag for new entries above!!!
You should always use the *upcoming* tag. For example, if 3.12a6 came out
Expand All @@ -289,7 +290,7 @@ PC/launcher.c must also be updated.

*/

#define PYC_MAGIC_NUMBER 3624
#define PYC_MAGIC_NUMBER 3650
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
(little-endian) and then appending b'\r\n'. */
#define PYC_MAGIC_NUMBER_TOKEN \
Expand Down
13 changes: 1 addition & 12 deletions Lib/sysconfig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,7 @@ def _safe_realpath(path):
if "_PYTHON_PROJECT_BASE" in os.environ:
_PROJECT_BASE = _safe_realpath(os.environ["_PYTHON_PROJECT_BASE"])

def is_python_build(check_home=None):
if check_home is not None:
import warnings
warnings.warn(
(
'The check_home argument of sysconfig.is_python_build is '
'deprecated and its value is ignored. '
'It will be removed in Python 3.15.'
),
DeprecationWarning,
stacklevel=2,
)
def is_python_build():
for fn in ("Setup", "Setup.local"):
if os.path.isfile(os.path.join(_PROJECT_BASE, "Modules", fn)):
return True
Expand Down
24 changes: 12 additions & 12 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2985,7 +2985,7 @@ def check_depr_star(self, pnames, fn, /, *args, name=None, **kwds):
regex = (
fr"Passing( more than)?( [0-9]+)? positional argument(s)? to "
fr"{re.escape(name)}\(\) is deprecated. Parameters? {pnames} will "
fr"become( a)? keyword-only parameters? in Python 3\.14"
fr"become( a)? keyword-only parameters? in Python 3\.37"
)
self.check_depr(regex, fn, *args, **kwds)

Expand All @@ -2998,7 +2998,7 @@ def check_depr_kwd(self, pnames, fn, *args, name=None, **kwds):
regex = (
fr"Passing keyword argument{pl} {pnames} to "
fr"{re.escape(name)}\(\) is deprecated. Parameter{pl} {pnames} "
fr"will become positional-only in Python 3\.14."
fr"will become positional-only in Python 3\.37."
)
self.check_depr(regex, fn, *args, **kwds)

Expand Down Expand Up @@ -3782,9 +3782,9 @@ def test_depr_star_multi(self):
fn("a", b="b", c="c", d="d", e="e", f="f", g="g", h="h")
errmsg = (
"Passing more than 1 positional argument to depr_star_multi() is deprecated. "
"Parameter 'b' will become a keyword-only parameter in Python 3.16. "
"Parameters 'c' and 'd' will become keyword-only parameters in Python 3.15. "
"Parameters 'e', 'f' and 'g' will become keyword-only parameters in Python 3.14.")
"Parameter 'b' will become a keyword-only parameter in Python 3.39. "
"Parameters 'c' and 'd' will become keyword-only parameters in Python 3.38. "
"Parameters 'e', 'f' and 'g' will become keyword-only parameters in Python 3.37.")
check = partial(self.check_depr, re.escape(errmsg), fn)
check("a", "b", c="c", d="d", e="e", f="f", g="g", h="h")
check("a", "b", "c", d="d", e="e", f="f", g="g", h="h")
Expand Down Expand Up @@ -3883,9 +3883,9 @@ def test_depr_kwd_multi(self):
fn("a", "b", "c", "d", "e", "f", "g", h="h")
errmsg = (
"Passing keyword arguments 'b', 'c', 'd', 'e', 'f' and 'g' to depr_kwd_multi() is deprecated. "
"Parameter 'b' will become positional-only in Python 3.14. "
"Parameters 'c' and 'd' will become positional-only in Python 3.15. "
"Parameters 'e', 'f' and 'g' will become positional-only in Python 3.16.")
"Parameter 'b' will become positional-only in Python 3.37. "
"Parameters 'c' and 'd' will become positional-only in Python 3.38. "
"Parameters 'e', 'f' and 'g' will become positional-only in Python 3.39.")
check = partial(self.check_depr, re.escape(errmsg), fn)
check("a", "b", "c", "d", "e", "f", g="g", h="h")
check("a", "b", "c", "d", "e", f="f", g="g", h="h")
Expand All @@ -3900,17 +3900,17 @@ def test_depr_multi(self):
self.assertRaises(TypeError, fn, "a", "b", "c", "d", "e", "f", "g")
errmsg = (
"Passing more than 4 positional arguments to depr_multi() is deprecated. "
"Parameter 'e' will become a keyword-only parameter in Python 3.15. "
"Parameter 'f' will become a keyword-only parameter in Python 3.14.")
"Parameter 'e' will become a keyword-only parameter in Python 3.38. "
"Parameter 'f' will become a keyword-only parameter in Python 3.37.")
check = partial(self.check_depr, re.escape(errmsg), fn)
check("a", "b", "c", "d", "e", "f", g="g")
check("a", "b", "c", "d", "e", f="f", g="g")
fn("a", "b", "c", "d", e="e", f="f", g="g")
fn("a", "b", "c", d="d", e="e", f="f", g="g")
errmsg = (
"Passing keyword arguments 'b' and 'c' to depr_multi() is deprecated. "
"Parameter 'b' will become positional-only in Python 3.14. "
"Parameter 'c' will become positional-only in Python 3.15.")
"Parameter 'b' will become positional-only in Python 3.37. "
"Parameter 'c' will become positional-only in Python 3.38.")
check = partial(self.check_depr, re.escape(errmsg), fn)
check("a", "b", c="c", d="d", e="e", f="f", g="g")
check("a", b="b", c="c", d="d", e="e", f="f", g="g")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Removed the ``check_home`` parameter from :func:`sysconfig.is_python_build`,
deprecated since Python 3.12.
Loading
Loading