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

Expose PyFrame_GetCode #2406

Merged
merged 2 commits into from May 29, 2022
Merged

Expose PyFrame_GetCode #2406

merged 2 commits into from May 29, 2022

Conversation

alex
Copy link
Contributor

@alex alex commented May 28, 2022

No description provided.

Copy link
Member

@mejrs mejrs left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -7,5 +9,6 @@ opaque_struct!(PyFrameObject);

extern "C" {
pub fn PyFrame_GetLineNumber(f: *mut PyFrameObject) -> c_int;
#[cfg(Py_3_9)]
pub fn PyFrame_GetCode(f: *mut PyFrameObject) -> *mut PyCodeObject;
Copy link
Member

@messense messense May 29, 2022

Choose a reason for hiding this comment

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

Since it's part of the stable ABI since 3.10, I think we can annotate it with #[cfg(any(Py_3_10, all(Py_3_9, not(Py_LIMITED_API))))]?

https://docs.python.org/3/c-api/reflection.html#c.PyFrame_GetCode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, done

@messense messense enabled auto-merge May 29, 2022 02:47
@messense messense merged commit f84c740 into PyO3:main May 29, 2022
@alex alex deleted the patch-1 branch May 29, 2022 03:39
davidhewitt added a commit to davidhewitt/pyo3 that referenced this pull request Jun 2, 2022
davidhewitt added a commit to davidhewitt/pyo3 that referenced this pull request Jun 2, 2022
davidhewitt added a commit that referenced this pull request Jun 2, 2022
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.

None yet

3 participants