Skip to content

Commit 2cc27f0

Browse files
committed
Make _pyc_magic_number private
1 parent ef9b4a1 commit 2cc27f0

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

Doc/library/sys.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,11 +1122,6 @@ always available.
11221122
``cache_tag`` is set to ``None``, it indicates that module caching should
11231123
be disabled.
11241124

1125-
*pyc_magic_number* is the magic number used to identify that cached ``.pyc``
1126-
files match the running version of Python.
1127-
1128-
.. versionadded:: 3.14
1129-
11301125
:data:`sys.implementation` may contain additional attributes specific to
11311126
the Python implementation. These non-standard attributes must start with
11321127
an underscore, and are not described here. Regardless of its contents,

Lib/importlib/_bootstrap_external.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def _write_atomic(path, data, mode=0o666):
221221

222222
_code_type = type(_write_atomic.__code__)
223223

224-
MAGIC_NUMBER = (sys.implementation.pyc_magic_number).to_bytes(2, 'little') + b'\r\n'
224+
MAGIC_NUMBER = (sys.implementation._pyc_magic_number).to_bytes(2, 'little') + b'\r\n'
225225

226226
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # for import.c
227227

Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3323,7 +3323,7 @@ make_impl_info(PyObject *version_info)
33233323
value = PyLong_FromLong(PYC_MAGIC_NUMBER);
33243324
if (value == NULL)
33253325
goto error;
3326-
res = PyDict_SetItemString(impl_info, "pyc_magic_number", value);
3326+
res = PyDict_SetItemString(impl_info, "_pyc_magic_number", value);
33273327
Py_DECREF(value);
33283328
if (res < 0)
33293329
goto error;

0 commit comments

Comments
 (0)