Skip to content

Keep removing pre-Python 3.8 code#218

Open
DimitriPapadopoulos wants to merge 1 commit intopython-cffi:mainfrom
DimitriPapadopoulos:UP036
Open

Keep removing pre-Python 3.8 code#218
DimitriPapadopoulos wants to merge 1 commit intopython-cffi:mainfrom
DimitriPapadopoulos:UP036

Conversation

@DimitriPapadopoulos
Copy link
Copy Markdown
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented Dec 10, 2025

Companion to #124 and #214.

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

Needs #214 to be applied first.

Copy link
Copy Markdown
Contributor

@mattip mattip left a comment

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

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?

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.

UP036 Version block is outdated for minimum Python version

Lots of manual fixes here, in order to discard Python 2 aliases.

Co-authored-by: Matti Picus <matti.picus@gmail.com>
@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as ready for review March 27, 2026 16:33
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.

2 participants