Skip to content

Commit

Permalink
Pull in main
Browse files Browse the repository at this point in the history
  • Loading branch information
erlend-aasland committed May 6, 2024
2 parents c84f2b7 + 716ec4b commit 161d50b
Show file tree
Hide file tree
Showing 14 changed files with 161 additions and 68 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Expand Up @@ -250,7 +250,7 @@ jobs:
build_ubuntu_ssltests:
name: 'Ubuntu SSL tests with OpenSSL'
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
Expand Down Expand Up @@ -316,7 +316,7 @@ jobs:

test_hypothesis:
name: "Hypothesis tests on Ubuntu"
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
Expand Down Expand Up @@ -429,7 +429,7 @@ jobs:

build_asan:
name: 'Address sanitizer'
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-ubuntu.yml
Expand Up @@ -12,7 +12,7 @@ jobs:
build_ubuntu_reusable:
name: 'build and test'
timeout-minutes: 60
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
FORCE_COLOR: 1
OPENSSL_VER: 3.0.13
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-wasi.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
build_wasi_reusable:
name: 'build and test'
timeout-minutes: 60
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
WASMTIME_VERSION: 18.0.3
WASI_SDK_VERSION: 21
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/long.rst
Expand Up @@ -390,7 +390,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
Usage example::
int32_t value;
Py_ssize_t bytes = PyLong_AsNativeBits(pylong, &value, sizeof(value), -1);
Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, &value, sizeof(value), -1);
if (bytes < 0) {
// Failed. A Python exception was set with the reason.
return NULL;
Expand Down Expand Up @@ -418,7 +418,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
called twice: first to determine the buffer size, then to fill it::
// Ask how much space we need.
Py_ssize_t expected = PyLong_AsNativeBits(pylong, NULL, 0, -1);
Py_ssize_t expected = PyLong_AsNativeBytes(pylong, NULL, 0, -1);
if (expected < 0) {
// Failed. A Python exception was set with the reason.
return NULL;
Expand All @@ -430,7 +430,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
return NULL;
}
// Safely get the entire value.
Py_ssize_t bytes = PyLong_AsNativeBits(pylong, bignum, expected, -1);
Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, bignum, expected, -1);
if (bytes < 0) { // Exception has been set.
free(bignum);
return NULL;
Expand Down
2 changes: 2 additions & 0 deletions Lib/idlelib/News3.txt
Expand Up @@ -4,6 +4,8 @@ Released on 2024-10-xx
=========================


gh-78955: Use user-selected color theme for Help => IDLE Doc.

gh-96905: In idlelib code, stop redefining built-ins 'dict' and 'object'.

gh-72284: Improve the lists of features, editor key bindings,
Expand Down
7 changes: 5 additions & 2 deletions Lib/idlelib/help.py
Expand Up @@ -33,6 +33,7 @@
from tkinter import font as tkfont

from idlelib.config import idleConf
from idlelib.colorizer import color_config

## About IDLE ##

Expand Down Expand Up @@ -177,14 +178,16 @@ def __init__(self, parent, filename):

normalfont = self.findfont(['TkDefaultFont', 'arial', 'helvetica'])
fixedfont = self.findfont(['TkFixedFont', 'monaco', 'courier'])
color_config(self)
self['font'] = (normalfont, 12)
self.tag_configure('em', font=(normalfont, 12, 'italic'))
self.tag_configure('h1', font=(normalfont, 20, 'bold'))
self.tag_configure('h2', font=(normalfont, 18, 'bold'))
self.tag_configure('h3', font=(normalfont, 15, 'bold'))
self.tag_configure('pre', font=(fixedfont, 12), background='#f6f6ff')
self.tag_configure('pre', font=(fixedfont, 12))
preback = self['selectbackground']
self.tag_configure('preblock', font=(fixedfont, 10), lmargin1=25,
borderwidth=1, relief='solid', background='#eeffcc')
background=preback)
self.tag_configure('l1', lmargin1=25, lmargin2=25)
self.tag_configure('l2', lmargin1=50, lmargin2=50)
self.tag_configure('l3', lmargin1=75, lmargin2=75)
Expand Down
14 changes: 7 additions & 7 deletions Lib/json/encoder.py
Expand Up @@ -244,15 +244,18 @@ def floatstr(o, allow_nan=self.allow_nan,
return text


if (_one_shot and c_make_encoder is not None
and self.indent is None):
if self.indent is None or isinstance(self.indent, str):
indent = self.indent
else:
indent = ' ' * self.indent
if _one_shot and c_make_encoder is not None:
_iterencode = c_make_encoder(
markers, self.default, _encoder, self.indent,
markers, self.default, _encoder, indent,
self.key_separator, self.item_separator, self.sort_keys,
self.skipkeys, self.allow_nan)
else:
_iterencode = _make_iterencode(
markers, self.default, _encoder, self.indent, floatstr,
markers, self.default, _encoder, indent, floatstr,
self.key_separator, self.item_separator, self.sort_keys,
self.skipkeys, _one_shot)
return _iterencode(o, 0)
Expand All @@ -272,9 +275,6 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
_intstr=int.__repr__,
):

if _indent is not None and not isinstance(_indent, str):
_indent = ' ' * _indent

def _iterencode_list(lst, _current_indent_level):
if not lst:
yield '[]'
Expand Down
4 changes: 2 additions & 2 deletions Makefile.pre.in
Expand Up @@ -2040,7 +2040,7 @@ testuniversal: all
# a full Xcode install that has an iPhone SE (3rd edition) simulator available.
# This must be run *after* a `make install` has completed the build. The
# `--with-framework-name` argument *cannot* be used when configuring the build.
XCFOLDER=iOSTestbed.$(MULTIARCH).$(shell date +%s)
XCFOLDER:=iOSTestbed.$(MULTIARCH).$(shell date +%s)
XCRESULT=$(XCFOLDER)/$(MULTIARCH).xcresult
.PHONY: testios
testios:
Expand All @@ -2067,7 +2067,7 @@ testios:

# Run the test suite for the Xcode project, targeting the iOS simulator.
# If the suite fails, touch a file in the test folder as a marker
if ! xcodebuild test -project $(XCFOLDER)/iOSTestbed.xcodeproj -scheme "iOSTestbed" -destination "platform=iOS Simulator,name=iPhone SE (3rd Generation)" -resultBundlePath $(XCRESULT) ; then \
if ! xcodebuild test -project $(XCFOLDER)/iOSTestbed.xcodeproj -scheme "iOSTestbed" -destination "platform=iOS Simulator,name=iPhone SE (3rd Generation)" -resultBundlePath $(XCRESULT) -derivedDataPath $(XCFOLDER)/DerivedData ; then \
touch $(XCFOLDER)/failed; \
fi

Expand Down
@@ -1,4 +1,4 @@
The :term:`interactive` interpreter is now implemented in Python, which
allows for a number of new features like colors, multiline input, history
viewing, and paste mode. Contributed by Pablo Galindo and Łukasz Langa based
on code from the PyPy project.
viewing, and paste mode. Contributed by Pablo Galindo, Łukasz Langa and
Lysandros Nikolaou based on code from the PyPy project.
@@ -0,0 +1,2 @@
Improve performance of :func:`json.dumps` and :func:`json.dump` when using the argument *indent*. Depending on the data the encoding using
:func:`json.dumps` with *indent* can be up to 2 to 3 times faster.
@@ -0,0 +1 @@
Use user-selected color theme for Help => IDLE Doc.

0 comments on commit 161d50b

Please sign in to comment.