Skip to content
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
25 changes: 19 additions & 6 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ code, or when embedding the Python interpreter:
This function is safe to call without an :term:`attached thread state`; it
will simply return ``NULL`` indicating that there was no prior thread state.

.. seealso:
.. seealso::
:c:func:`PyEval_ReleaseThread`

.. note::
Expand All @@ -1124,6 +1124,19 @@ code, or when embedding the Python interpreter:
The following functions use thread-local storage, and are not compatible
with sub-interpreters:

.. c:type:: PyGILState_STATE

The type of the value returned by :c:func:`PyGILState_Ensure` and passed to
:c:func:`PyGILState_Release`.

.. c:enumerator:: PyGILState_LOCKED

The GIL was already held when :c:func:`PyGILState_Ensure` was called.

.. c:enumerator:: PyGILState_UNLOCKED

The GIL was not held when :c:func:`PyGILState_Ensure` was called.

.. c:function:: PyGILState_STATE PyGILState_Ensure()

Ensure that the current thread is ready to call the Python C API regardless
Expand Down Expand Up @@ -1174,12 +1187,12 @@ with sub-interpreters:
made on the main thread. This is mainly a helper/diagnostic function.

.. note::
This function does not account for :term:`thread states <thread state>` created
by something other than :c:func:`PyGILState_Ensure` (such as :c:func:`PyThreadState_New`).
This function may return non-``NULL`` even when the :term:`thread state`
is detached.
Prefer :c:func:`PyThreadState_Get` or :c:func:`PyThreadState_GetUnchecked`
for most cases.

.. seealso: :c:func:`PyThreadState_Get``
.. seealso:: :c:func:`PyThreadState_Get`

.. c:function:: int PyGILState_Check()

Expand Down Expand Up @@ -1278,11 +1291,11 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
must be :term:`attached <attached thread state>`

.. versionchanged:: 3.9
This function now calls the :c:member:`PyThreadState.on_delete` callback.
This function now calls the :c:member:`!PyThreadState.on_delete` callback.
Previously, that happened in :c:func:`PyThreadState_Delete`.

.. versionchanged:: 3.13
The :c:member:`PyThreadState.on_delete` callback was removed.
The :c:member:`!PyThreadState.on_delete` callback was removed.


.. c:function:: void PyThreadState_Delete(PyThreadState *tstate)
Expand Down
5 changes: 2 additions & 3 deletions Doc/library/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,8 @@ Random generation
.. function:: RAND_status()

Return ``True`` if the SSL pseudo-random number generator has been seeded
with 'enough' randomness, and ``False`` otherwise. You can use
:func:`ssl.RAND_egd` and :func:`ssl.RAND_add` to increase the randomness of
the pseudo-random number generator.
with 'enough' randomness, and ``False`` otherwise. Use :func:`ssl.RAND_add`
to increase the randomness of the pseudo-random number generator.

.. function:: RAND_add(bytes, entropy, /)

Expand Down
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

Doc/c-api/descriptor.rst
Doc/c-api/float.rst
Doc/c-api/init.rst
Doc/c-api/init_config.rst
Doc/c-api/intro.rst
Doc/c-api/module.rst
Expand Down
2 changes: 1 addition & 1 deletion Lib/idlelib/colorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def make_pat():
name not in keyword.kwlist]
builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
comment = any("COMMENT", [r"#[^\n]*"])
stringprefix = r"(?i:r|u|f|fr|rf|b|br|rb)?"
stringprefix = r"(?i:r|u|f|fr|rf|b|br|rb|t|rt|tr)?"
sqstring = stringprefix + r"'[^'\\\n]*(\\.[^'\\\n]*)*'?"
dqstring = stringprefix + r'"[^"\\\n]*(\\.[^"\\\n]*)*"?'
sq3string = stringprefix + r"'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
Expand Down
29 changes: 15 additions & 14 deletions Lib/idlelib/idle_test/test_colorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ async def f(): await g()
# All valid prefixes for unicode and byte strings should be colored.
r'x', u'x', R'x', U'x', f'x', F'x'
fr'x', Fr'x', fR'x', FR'x', rf'x', rF'x', Rf'x', RF'x'
tr'x', Tr'x', tR'x', TR'x', rt'x', rT'x', Rt'x', RT'x'
b'x',B'x', br'x',Br'x',bR'x',BR'x', rb'x', rB'x',Rb'x',RB'x'
# Invalid combinations of legal characters should be half colored.
ur'x', ru'x', uf'x', fu'x', UR'x', ufr'x', rfu'x', xf'x', fx'x'
Expand Down Expand Up @@ -390,19 +391,19 @@ def test_recolorize_main(self, mock_notify):
('6.0', ('KEYWORD',)), ('6.10', ('DEFINITION',)), ('6.11', ()),
('8.0', ('STRING',)), ('8.4', ()), ('8.5', ('STRING',)),
('8.12', ()), ('8.14', ('STRING',)),
('19.0', ('KEYWORD',)),
('20.4', ('KEYWORD',)), ('20.16', ('KEYWORD',)),# ('20.19', ('KEYWORD',)),
#('22.4', ('KEYWORD',)), ('22.10', ('KEYWORD',)), ('22.14', ('KEYWORD',)), ('22.19', ('STRING',)),
#('23.12', ('KEYWORD',)),
('24.8', ('KEYWORD',)),
('25.4', ('KEYWORD',)), ('25.9', ('KEYWORD',)),
('25.11', ('KEYWORD',)), ('25.15', ('STRING',)),
('25.19', ('KEYWORD',)), ('25.22', ()),
('25.24', ('KEYWORD',)), ('25.29', ('BUILTIN',)), ('25.37', ('KEYWORD',)),
('26.4', ('KEYWORD',)), ('26.9', ('KEYWORD',)),# ('26.11', ('KEYWORD',)), ('26.14', (),),
('27.25', ('STRING',)), ('27.38', ('STRING',)),
('29.0', ('STRING',)),
('30.1', ('STRING',)),
('20.0', ('KEYWORD',)),
('21.4', ('KEYWORD',)), ('21.16', ('KEYWORD',)),# ('21.19', ('KEYWORD',)),
#('23.4', ('KEYWORD',)), ('23.10', ('KEYWORD',)), ('23.14', ('KEYWORD',)), ('23.19', ('STRING',)),
#('24.12', ('KEYWORD',)),
('25.8', ('KEYWORD',)),
('26.4', ('KEYWORD',)), ('26.9', ('KEYWORD',)),
('26.11', ('KEYWORD',)), ('26.15', ('STRING',)),
('26.19', ('KEYWORD',)), ('26.22', ()),
('26.24', ('KEYWORD',)), ('26.29', ('BUILTIN',)), ('26.37', ('KEYWORD',)),
('27.4', ('KEYWORD',)), ('27.9', ('KEYWORD',)),# ('27.11', ('KEYWORD',)), ('27.14', (),),
('28.25', ('STRING',)), ('28.38', ('STRING',)),
('30.0', ('STRING',)),
('31.1', ('STRING',)),
# SYNC at the end of every line.
('1.55', ('SYNC',)), ('2.50', ('SYNC',)), ('3.34', ('SYNC',)),
)
Expand Down Expand Up @@ -433,7 +434,7 @@ def test_recolorize_main(self, mock_notify):
eq(text.tag_nextrange('STRING', '8.12'), ('8.14', '8.17'))
eq(text.tag_nextrange('STRING', '8.17'), ('8.19', '8.26'))
eq(text.tag_nextrange('SYNC', '8.0'), ('8.26', '9.0'))
eq(text.tag_nextrange('SYNC', '30.0'), ('30.10', '32.0'))
eq(text.tag_nextrange('SYNC', '31.0'), ('31.10', '33.0'))

def _assert_highlighting(self, source, tag_ranges):
"""Check highlighting of a given piece of code.
Expand Down
5 changes: 0 additions & 5 deletions Lib/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@
)
from _ssl import txt2obj as _txt2obj, nid2obj as _nid2obj
from _ssl import RAND_status, RAND_add, RAND_bytes
try:
from _ssl import RAND_egd
except ImportError:
# RAND_egd is not supported on some platforms
pass
from _ssl import get_sigalgs


Expand Down
Loading
Loading