Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-76595: PyCapsule_Import() now imports submodules if needed.#6898

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
serhiy-storchaka wants to merge5 commits intopython:main
base:main
Choose a base branch
Loading
fromserhiy-storchaka:capsule-import-submodules

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedMay 16, 2018
edited by bedevere-appbot
Loading

@encukou
Copy link
Member

Do you plan to add tests, or are you OK leaving that to someone else?

@serhiy-storchaka
Copy link
MemberAuthor

Currently there are no any tests for PyCapsule. I'm going to write them if possible, but this will take a time.

@encukou
Copy link
Member

I'm asking because writing tests would make a nice task for mentoring someone – but it would take even more time that way.

}
}
} else {
if (object) {
PyObject *object2 = PyObject_GetAttrString(object, trace);
Py_DECREF(object);
object = object2;
Copy link
Member

Choose a reason for hiding this comment

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

Py_SETREF?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yes, it can be used here.

if (no_block) {
object = PyImport_ImportModuleNoBlock(name_dup);
} else {
object = PyImport_ImportModule(name_dup);
Copy link
Contributor

Choose a reason for hiding this comment

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

aren't PyImport_ImportModuleNoBlock and PyImport_ImportModule the same thing now?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Good point!

Py_DECREF(object);
object = object2;
if (object) {
Py_SETREF(object, PyObject_GetAttrString(object, trace));
Copy link
Member

Choose a reason for hiding this comment

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

I would expect error handling here, if PyObject_GetAttrString() fails for whatever reason. It seems like PyImport_ImportModule() is tried on the substring on error.

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment:I have made the requested changes; please review again.

@csabella
Copy link
Contributor

@serhiy-storchaka, it looks like this one was close to being merged, so just putting it back on the radar.

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelAug 19, 2022
@WillAyd
Copy link
Contributor

I have a use case for this and would be happy to rebase / take over from@serhiy-storchaka if you don't have the time for it

@github-actionsgithub-actionsbot removed the staleStale PR or inactive for long period of time. labelSep 21, 2024
@github-actionsGitHub Actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelDec 15, 2024
@picnixzpicnixz changed the titlebpo-32414: PyCapsule_Import() now imports submodules if needed.gh-76595: PyCapsule_Import() now imports submodules if needed.Dec 15, 2024
@github-actionsgithub-actionsbot removed the staleStale PR or inactive for long period of time. labelFeb 27, 2025
@github-actionsGitHub Actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelApr 9, 2025
NicolasT added a commit to NicolasT/cpython that referenced this pull requestMay 14, 2025
There's a PR (pythonGH-6898) which changes this behavior (to be lesssurprising, I believe), but this seems to have stalled.See:python#76595See:python#6898
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@lekmalekmalekma left review comments

@vstinnervstinnervstinner requested changes

@zoobazoobazooba approved these changes

Assignees
No one assigned
Labels
awaiting changesstaleStale PR or inactive for long period of time.type-featureA feature request or enhancement
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

10 participants
@serhiy-storchaka@encukou@bedevere-bot@csabella@WillAyd@vstinner@lekma@zooba@the-knights-who-say-ni@ezio-melotti

[8]ページ先頭

©2009-2025 Movatter.jp