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 deprecation warning for specifying strict_exception_groups=False #2941

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

jakkdl
Copy link
Member

@jakkdl jakkdl commented Jan 31, 2024

Wasn't totally sure which issue to refer to, ended up going with #2929

the removed with block in test_subprocess was added to try and track down some weirdness in #2886 (comment) - but I don't think it served much of a purpose in the end, so opted now to remove it instead of wrapping it in a pytest.warns.

@jakkdl jakkdl requested review from Zac-HD and A5rocks January 31, 2024 12:20
Copy link

codecov bot commented Jan 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b6a31d7) 99.64% compared to head (06168d2) 99.64%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2941   +/-   ##
=======================================
  Coverage   99.64%   99.64%           
=======================================
  Files         116      117    +1     
  Lines       17521    17564   +43     
  Branches     3151     3166   +15     
=======================================
+ Hits        17459    17502   +43     
  Misses         43       43           
  Partials       19       19           
Files Coverage Δ
src/trio/_core/_run.py 99.66% <100.00%> (+<0.01%) ⬆️
src/trio/_core/_tests/test_run.py 100.00% <100.00%> (ø)
...ts/test_deprecate_strict_exception_groups_false.py 100.00% <100.00%> (ø)
src/trio/_tests/test_subprocess.py 99.23% <ø> (-0.01%) ⬇️

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

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

Looks good - thanks @jakkdl!

src/trio/_core/_run.py Show resolved Hide resolved
@CoolCat467
Copy link
Member

Making sure, nothing can go wrong with the literal is False compare? No one could set strict exception groups to a value that could be interpreted as the False branch?

@jakkdl
Copy link
Member Author

jakkdl commented Feb 1, 2024

Making sure, nothing can go wrong with the literal is False compare? No one could set strict exception groups to a value that could be interpreted as the False branch?

Right, if somebody is supplying a falsy value of an incorrect type they're not gonna get a warning. So I suppose I could do

if not strict_exception_groups and strict_exception_groups is not None:
    ...

Don't think we need to be that defensive, but I guess it also doesn't hurt.

@Zac-HD Zac-HD merged commit 0dd5bc4 into python-trio:master Feb 1, 2024
30 checks passed
@jakkdl jakkdl deleted the deprecate_exceptiongroups_false branch February 2, 2024 10:15
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