Skip to content

Keep removing Python pre-3.9 code - #218

Open
DimitriPapadopoulos wants to merge 11 commits into
python-cffi:mainfrom
DimitriPapadopoulos:UP036
Open

DimitriPapadopoulos wants to merge 11 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 Outdated
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
@DimitriPapadopoulos
DimitriPapadopoulos marked this pull request as draft July 19, 2026 20:33
@DimitriPapadopoulos
DimitriPapadopoulos force-pushed the UP036 branch 2 times, most recently from 8c5ba8e to 548326f Compare July 19, 2026 21:42
@DimitriPapadopoulos DimitriPapadopoulos changed the title Keep removing pre-Python 3.9 code Keep removing Python pre-3.9 code Jul 19, 2026
@DimitriPapadopoulos
DimitriPapadopoulos force-pushed the UP036 branch 2 times, most recently from ee3070f to 2de1e2b Compare July 20, 2026 07:57
@DimitriPapadopoulos
DimitriPapadopoulos force-pushed the UP036 branch 2 times, most recently from 91e3386 to 91dbf49 Compare October 26, 2026 00:15
@DimitriPapadopoulos
DimitriPapadopoulos marked this pull request as ready for review October 26, 2026 00:17
@DimitriPapadopoulos

Copy link
Copy Markdown
Contributor Author

More changes are needed, such as getting rid of tests of old versions of MSVC (2010 or 2013), or references to Python 2.7 in the documentation. I'd rather leave such changes for later PRs.

@DimitriPapadopoulos
DimitriPapadopoulos force-pushed the UP036 branch 4 times, most recently from c611bd9 to c4db10e Compare October 27, 2026 17:02
@DimitriPapadopoulos
DimitriPapadopoulos marked this pull request as draft October 27, 2026 17:09
@DimitriPapadopoulos
DimitriPapadopoulos force-pushed the UP036 branch 4 times, most recently from 10e1c9f to 959b327 Compare October 27, 2026 22:19
@DimitriPapadopoulos

Copy link
Copy Markdown
Contributor Author

Rebased - painfully 😄

@DimitriPapadopoulos
DimitriPapadopoulos marked this pull request as ready for review October 27, 2026 22:46
@mattip

mattip commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Now I have to go through the whole thing again. There were only two small nits 7 months ago, too bad it was not handled in a timely manner then.

@DimitriPapadopoulos

Copy link
Copy Markdown
Contributor Author

I'm sorry about it. It was still a draft at the time, it took me quite some time to iron our small issues and make sure all changes are correct.

Both suggestions have been taken into account:

These are automatic fixes using:
* `--select UP036 --fix --unsafe-fixes`
These are manual fixes of testing/conftest.py
These are manual fixes of testing/udir.py
These are manual fixes of testing/embedding/
These are manual fixes of testing/cffi1/
These are manual fixes of testing/cffi0/
These are manual fixes of testing/support.py
DimitriPapadopoulos and others added 3 commits October 28, 2026 10:05
These are manual fixes of src/c/test_c.py

Co-Authored-By: mattip <matti.picus@gmail.com>
These are manual fixes of src/cffi/

Co-Authored-By: mattip <matti.picus@gmail.com>
These are manual fixes of src/c/

wchar_helper_3.h → wchar_helper.h
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