When scanning the string, most characters are valid, so
checking for invalid characters first means never needing
to check the value of strict on valid strings, and only
needing to check it on invalid characters when doing
non-strict parsing of invalid strings.
This provides a measurable reduction in per-character
processing time (~11% in the pre-merge patch testing).
(cherry picked from commit 8a758f5b99)
Co-authored-by: Marco Paolini <mpaolini@users.noreply.github.com>
They pass with tk 8.5.9 (Azure) but fail with the 8.6.x we install.
(cherry picked from commit e8874b85b4)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
https://bugs.python.org/issue37500
Add a new field to the compiler structure that allows to be configured
so no bytecode is emitted. In this way is possible to detect errors by
walking the nodes while preserving optimizations.
https://bugs.python.org/issue37500
(cherry picked from commit 18c5f9d44d)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-37697: Sync with importlib_metadata 0.19
* Run make regen-importlib
* 📜🤖 Added by blurb_it.
(cherry picked from commit 049460da9c)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Use an example shell interaction in the sample and better labels for shell elements.
(cherry picked from commit b222955355)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
The boxes for the font and highlight samples are now constrained by the overall config dialog size. They gain scrollbars when the when a large font size makes the samples too large for the box.
(cherry picked from commit 3221a63c69)
Co-authored-by: Tal Einat <taleinat+github@gmail.com>
Previously, pyc files in the embeddable distribution reported their
location as <build path>/<file stem>.py. This causes a little confusion
when interpreting stack traces as the file is in a (almost certainly)
incorrect location, and lacks the full relative path to Lib (e.g.
email/mime/image.py will only show image.py).
This change preserves the Lib relative location of the source file as a
path so that stack traces are (hopefully) less misleading and more
informative.
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit c4cda4369f)
Co-authored-by: Bill Collins <bilbocollins@gmail.com>
Prior to this change the guard on an 'elif' used an assignment expression whose value was used in a later 'else' block, causing some confusion for people.
(Discussion on Twitter: https://twitter.com/brettsky/status/1153861041068994566.)
Automerge-Triggered-By: @brettcannon
(cherry picked from commit 544fa15ea1)
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
* bpo-37399: Correctly attach tail text to the last element/comment/pi, even when comments or pis are discarded.
Also fixes the insertion of PIs when "insert_pis=True" is configured for a TreeBuilder.
* Fix the formatting in the documentation of the tostring() functions.
* bpo-34160: Document that the tostring() and tostringlist() functions also preserve the attribute order now.
* bpo-34160: Add an explanation of how users should deal with the attribute order.
(cherry picked from commit a3697db010)
Co-authored-by: Stefan Behnel <stefan_ml@behnel.de>
Verify that it appears to find roughly the right number of tests in the stdlib's testsuite.
(cherry picked from commit e95ac20103)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Reduce the number of unit tests run for the PGO generation task. This
speeds up the task by a factor of about 15x. Running the full unit test
suite is slow. This change may result in a slightly less optimized build
since not as many code branches will be executed. If you are willing to
wait for the much slower build, the old behavior can be restored using
'./configure [..] PROFILE_TASK="-m test --pgo-extended"'. We make no
guarantees as to which PGO task set produces a faster build. Users who
care should run their own relevant benchmarks as results can depend on
the environment, workload, and compiler tool chain.
(cherry picked from commit 4e16a4a311)
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
* Clear name and parent of mock in autospecced objects used with attach_mock
* Add NEWS entry
* Fix reversed order of comparison
* Test child and standalone function calls
* Use a helper function extracting mock to avoid code duplication and refactor tests.
(cherry picked from commit 7397cda997)
Co-authored-by: Xtreak <tir.karthi@gmail.com>
Repeat the command line arguments most recently entered before so the user can edit them.
(cherry picked from commit 35b87e6001)
Co-authored-by: Ngalim Siregar <ngalim.siregar@gmail.com>