Fix AttributeError doctests when output includes a suggestion (part of python 3.12 support)#36403
Merged
vbraun merged 2 commits intosagemath:developfrom Oct 14, 2023
Merged
Conversation
|
Documentation preview for this PR (built with commit f1b77b1; changes) is ready! 🎉 |
This was referenced Oct 5, 2023
Member
|
merge conflict |
In python 3.12, attribute errors add a suggestion at the end of the
usual error message ("Did you mean ...?").
We add ... at the end of these doctest outputs to fix it.
This commit has the bulk of the changes, obtained with:
git grep -l "AttributeError:" src | xargs sed -ie \
's/^ *\(AttributeError: .*\)\?has no attribute.*$/&.../'
In python 3.12, attribute errors add a suggestion at the end of the
usual error message ("Did you mean ...?").
We add ... at the end of these doctest outputs to fix it.
This commit has a few manual changes which didn't match the sed pattern
in the previous commit.
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Oct 19, 2023
sagemathgh-36407: Support python 3.12 This PR adds support for running with python 3.12 from system. This has been tested on the python 3.12 branch of void linux (x86_64, x86_64-musl and i686). The first two commits correspond to sagemath#36403. The rest is split is small pieces and I tried to add reasonable explanations in the commit messages. Reviewing by commit may be easier (ignoring the first two, already reviewed). See also: sagemath#36181 ### ⌛ Dependencies sagemath#36403 URL: sagemath#36407 Reported by: Gonzalo Tornaría Reviewer(s): Matthias Köppe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In python 3.12, attribute errors add a suggestion at the end of the
usual error message ("Did you mean ...?").
We add ... at the end of these doctest outputs to fix it.
This PR is split in two commits:
Since this changes a lot of files and is bound to get old, I'd appreciate a quick review + merge to avoid trouble (the PR is long but almost trivial and the review should be easy).
I'll soon make a separate PR (on top of this one) with the rest of the support python 3.12 changes, which are maybe not so trivial but much shorter than this one.
Related: #36181
@mkoeppe 🙏