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

Add exception handling for libcpp::stack::push #4710

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

jjerphan
Copy link
Contributor

@jjerphan jjerphan commented Apr 1, 2022

This adds a simple exception handling to stack::pop.

Tests are to be added, if needed.

@da-woods
Copy link
Contributor

da-woods commented Apr 1, 2022

I wonder if this should be applied to basically all stack functions? As far as I can tell they can all potentially throw exceptions (since it doesn't make assumptions about what the underlying container might do). But push is probably the most likely to throw I think.

@jjerphan
Copy link
Contributor Author

jjerphan commented Apr 4, 2022

Yes, I am first trying to understand some of the CI failures which do not seem to be related to the changes here.

-- stderr:/Users/runner/hostedtoolcache/Python/3.9.11/x64/lib/python3.9/site-packages/_distutils_hack/__init__.py:17: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.

@da-woods
Copy link
Contributor

da-woods commented Apr 4, 2022

Closing and reopening to retrigger the CI - I can't see any way that the failures are related.

@da-woods da-woods closed this Apr 4, 2022
@da-woods da-woods reopened this Apr 4, 2022
@jjerphan
Copy link
Contributor Author

jjerphan commented Apr 4, 2022

Indeed, they are gone, now.

Must I add tests?

@da-woods
Copy link
Contributor

da-woods commented Apr 4, 2022

We've accepted similar PRs without tests before (#4079) so I don't think they're really necessary here.

@jjerphan jjerphan marked this pull request as ready for review April 4, 2022 18:55
@robertwb robertwb merged commit 786e974 into cython:master Apr 5, 2022
@jjerphan jjerphan deleted the stack-pop-exception-handling branch April 5, 2022 15:28
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