Sitelet https://web.archive.org/web/20231116025305/https://github.com/github/codeql/pull/14791
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: Update .expected to support Python 3.12 #14791

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

RasmusWL
Copy link
Member

You might wonder why the number of lines changed, but it's due to tty module receiving its' first update since 2001, so the actual number of lines DID change :phew:

https://github.com/python/cpython/commits/3.12/Lib/tty.py

@RasmusWL RasmusWL added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Nov 15, 2023
@RasmusWL RasmusWL marked this pull request as ready for review November 15, 2023 09:48
@RasmusWL RasmusWL requested a review from a team as a code owner November 15, 2023 09:48
yoff
yoff previously approved these changes Nov 15, 2023
Copy link
Contributor

@yoff yoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks entirely plausible :shipit:

You might wonder why the number of lines changed, but it's due to `tty`
module receiving its' first update since 2001, so the actual number of
lines DID change :phew:

https://github.com/python/cpython/commits/3.12/Lib/tty.py

Since there is now a difference between Python 2 and Python 3, we need to restrict the lines of code test to only run as Python 3.
…ic directory

This moves the tests to Python 2, next we copy them to Python 3.
Was removed in 3.11, see https://docs.python.org/3.10/library/asyncio-task.html#asyncio.coroutine

I couldn't make the __awwait__ actually give the result to the agen function...

I also tried looking into
https://docs.python.org/3/library/types.html#types.coroutine, but also
failed to make that work.

Without the Future, such as doing `yield SOURCE` inside `__await__` it
complains `RuntimeError: Task got bad yield: 'source'`
I reckon this is due to the Python 3 version used by the Python 2 tests
is different from 3.12, so even with --lang=3 the tests are still using
an incompatible version :(
@RasmusWL RasmusWL requested a review from yoff November 15, 2023 14:57
Copy link
Contributor

@yoff yoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
depends on internal PR This PR should only be merged in sync with an internal Semmle PR Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants