Skip to content

Commit

Permalink
Merge branch 'main' into pythongh-115999-thread-local-bytecode
Browse files Browse the repository at this point in the history
  • Loading branch information
mpage committed Oct 19, 2024
2 parents 1a48ab2 + 2bb7ab7 commit b16ae5f
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reusable-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- name: 'Set up Python'
uses: actions/setup-python@v5
with:
python-version: '3.12' # known to work with Sphinx 6.2.1
python-version: '3.13' # known to work with Sphinx 7.2.6
cache: 'pip'
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
- name: 'Install build dependencies'
Expand Down
2 changes: 1 addition & 1 deletion Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
highlight_language = 'python3'

# Minimum version of sphinx required
needs_sphinx = '6.2.1'
needs_sphinx = '7.2.6'

# Create table of contents entries for domain objects (e.g. functions, classes,
# attributes, etc.). Default is True.
Expand Down
30 changes: 15 additions & 15 deletions Doc/requirements-oldest-sphinx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ blurb
python-docs-theme>=2022.1

# Generated from:
# pip install "Sphinx~=6.2.1"
# pip install "Sphinx~=7.2.6"
# pip freeze
#
# Sphinx 6.2.1 comes from ``needs_sphinx = '6.2.1'`` in ``Doc/conf.py``.
# Sphinx 7.2.6 comes from ``needs_sphinx = '7.2.6'`` in ``Doc/conf.py``.

alabaster==0.7.16
Babel==2.15.0
certifi==2024.7.4
charset-normalizer==3.3.2
docutils==0.19
idna==3.7
Babel==2.16.0
certifi==2024.8.30
charset-normalizer==3.4.0
docutils==0.20.1
idna==3.10
imagesize==1.4.1
Jinja2==3.1.4
MarkupSafe==2.1.5
MarkupSafe==3.0.1
packaging==24.1
Pygments==2.18.0
requests==2.32.3
snowballstemmer==2.2.0
Sphinx==6.2.1
sphinxcontrib-applehelp==1.0.8
sphinxcontrib-devhelp==1.0.6
sphinxcontrib-htmlhelp==2.0.5
Sphinx==7.2.6
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.7
sphinxcontrib-serializinghtml==1.1.10
urllib3==2.2.2
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
urllib3==2.2.3
13 changes: 13 additions & 0 deletions Lib/test/test_concurrent_futures/test_interpreter_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,19 @@ def test_idle_thread_reuse(self):

class AsyncioTest(InterpretersMixin, testasyncio_utils.TestCase):

@classmethod
def setUpClass(cls):
# Most uses of asyncio will implicitly call set_event_loop_policy()
# with the default policy if a policy hasn't been set already.
# If that happens in a test, like here, we'll end up with a failure
# when --fail-env-changed is used. That's why the other tests that
# use asyncio are careful to set the policy back to None and why
# we're careful to do so here. We also validate that no other
# tests left a policy in place, just in case.
policy = support.maybe_get_event_loop_policy()
assert policy is None, policy
cls.addClassCleanup(lambda: asyncio.set_event_loop_policy(None))

def setUp(self):
super().setUp()
self.loop = asyncio.new_event_loop()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Require Sphinx 7.2.6 or later to build the Python documentation.
Patch by Adam Turner.
2 changes: 1 addition & 1 deletion Python/jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction trace[], siz
// Loop once to find the total compiled size:
size_t code_size = 0;
size_t data_size = 0;
jit_state state = {};
jit_state state = {0};
group = &trampoline;
code_size += group->code_size;
data_size += group->data_size;
Expand Down
2 changes: 1 addition & 1 deletion Tools/jit/_stencils.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def _get_trampoline_mask(self) -> str:
word = bitmask & ((1 << 32) - 1)
trampoline_mask.append(f"{word:#04x}")
bitmask >>= 32
return "{" + ", ".join(trampoline_mask) + "}"
return "{" + (", ".join(trampoline_mask) or "0") + "}"

def as_c(self, opname: str) -> str:
"""Dump this hole as a StencilGroup initializer."""
Expand Down
7 changes: 5 additions & 2 deletions Tools/jit/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ def _dump_footer(
yield "};"
yield ""
yield f"static const void * const symbols_map[{max(len(symbols), 1)}] = {{"
for symbol, ordinal in symbols.items():
yield f" [{ordinal}] = &{symbol},"
if symbols:
for symbol, ordinal in symbols.items():
yield f" [{ordinal}] = &{symbol},"
else:
yield " 0"
yield "};"


Expand Down

0 comments on commit b16ae5f

Please sign in to comment.