Skip to content

Keep removing Python pre-3.9 code#218

Draft
DimitriPapadopoulos wants to merge 3 commits into
python-cffi:mainfrom
DimitriPapadopoulos:UP036
Draft

Keep removing Python pre-3.9 code#218
DimitriPapadopoulos wants to merge 3 commits into
python-cffi:mainfrom
DimitriPapadopoulos:UP036

Conversation

@DimitriPapadopoulos

@DimitriPapadopoulos DimitriPapadopoulos commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

Companion to #124 and #214.

Apply rule UP036, it implies lots of manual changes and requires extra care.

Needs #214 to be applied first.

@mattip mattip left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I actually read the whole thing and only had two nits

Comment thread src/c/test_c.py Outdated
import __builtin__
except ImportError:
import builtins as __builtin__
import builtins

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this can be removed?

Comment thread src/cffi/lock.py
try:
from _thread import allocate_lock
except ImportError:
from _dummy_thread import allocate_lock

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When might this fail? I think _thread is required for Python now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed _threadhas always been part of Python 3.

@DimitriPapadopoulos
DimitriPapadopoulos marked this pull request as ready for review March 27, 2026 16:33
@DimitriPapadopoulos
DimitriPapadopoulos force-pushed the UP036 branch 3 times, most recently from 2b0bbe5 to b594ec7 Compare March 30, 2026 22:37
@DimitriPapadopoulos DimitriPapadopoulos changed the title Keep removing pre-Python 3.8 code Keep removing pre-Python 3.9 code Mar 30, 2026
@DimitriPapadopoulos
DimitriPapadopoulos force-pushed the UP036 branch 3 times, most recently from 190b007 to 95033ea Compare March 30, 2026 22:40
@DimitriPapadopoulos
DimitriPapadopoulos marked this pull request as draft March 30, 2026 22:40
@MLopez-Ibanez

Copy link
Copy Markdown

This may need to be rebased and retested.

@DimitriPapadopoulos

Copy link
Copy Markdown
Contributor Author

Yes, this is still a work in progress. Some changes break CI. I need to apply smaller change sets gradually — after rebasing.

@DimitriPapadopoulos
DimitriPapadopoulos force-pushed the UP036 branch 2 times, most recently from 2240429 to 938ddcd Compare April 29, 2026 18:05
@DimitriPapadopoulos
DimitriPapadopoulos marked this pull request as ready for review July 19, 2026 19:56
These are automatic fixes using:
* `--select UP036 --fix --unsafe-fixes`
@DimitriPapadopoulos DimitriPapadopoulos changed the title Keep removing pre-Python 3.9 code Keep removing Python pre-3.9 code Jul 19, 2026
These are manual fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants