◐ Shell
clean mode source ↗

gh-110964: clinic: pass clinic argument to bad_argument() by vstinner · Pull Request #110984 · python/cpython

@vstinner

@vstinner vstinner commented

Oct 17, 2023

edited by bedevere-app Bot

Loading

@vstinner

The only purpose of this change is to avoid using clinic global variable in def bad_argument() method. Just for that, I had to modify many lines :-(

@vstinner

@AlexWaygood

Please give me some time to look at this! :-)

@vstinner

"Check if generated files are up to date (pull_request)" failure looks unrelated:

./configure --config-cache --with-pydebug --enable-shared
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.6/x64/lib/pkgconfig

configure: loading cache config.cache
configure: error: `PKG_CONFIG_PATH' has changed since the previous run:
configure:   former value:  `/opt/hostedtoolcache/Python/3.11.5/x64/lib/pkgconfig'
configure:   current value: `/opt/hostedtoolcache/Python/3.11.6/x64/lib/pkgconfig'
Don't rely on the global 'clinic' argument: pass explicitly a
'clinic' argument.

@vstinner

I rebased my PR on the main branch to try to fix the "Check if generated files are up to date" job failure.

@vstinner

Please give me some time to look at this! :-)

Mmmmh, so do you need more time to review?

@vstinner

Well, since @AlexWaygood is not available for review, i think that i will just merge my change next days.

@AlexWaygood

Thanks for waiting, sorry for the slow response from me! I wanted to take the time to think about this properly, but haven't had a chance recently due to being busy at work, and it's unlikely that I'll have the time in the next week either.

My instinct is that there should be a simpler solution here that involves fewer changes, but if you feel like there's a rush to get this merged for whatever reason, then please go ahead. I agree I've kept you waiting for a while :-)

@vstinner

me:

The only purpose of this change is to avoid using clinic global variable in def bad_argument() method. Just for that, I had to modify many lines :-(

@AlexWaygood:

My instinct is that there should be q simpler solution here that involves fewer changes,

Yeah, there should be a way to redesign the code to have to pass less arguments. I dislike the current API :-( Moreover, passing limited_capi and clinic is kind of redundant, since using clinic.limited_capi is the same as passing limited_capi.

I close my PR for now. We can revisit this code later when we will try to give rid of the global clinic variable.