Fix __repr__ race (Free-Threaded)#1328
Conversation
__repr__ race (Free-Threaded)
| import sysconfig | ||
| import textwrap | ||
|
|
||
| FREETHREADED = bool(sysconfig.get_config_var("Py_GIL_DISABLED")) |
There was a problem hiding this comment.
I think this should be moved to the skipif mark in the pytest param.
There was a problem hiding this comment.
I do also since we seem to have a ton of bugs to patch. I was thinking about a new module called test_free_threaded.py when #1327 is merged to just have both of them in a new file.
There was a problem hiding this comment.
Let's see if @Dreamsorcerer and @bdraco have opinions on this, then.
There was a problem hiding this comment.
Surely the tests should pass on regular versions of Python?
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
|
|
||
|
|
||
| if __name__ == "__main__" and FREETHREADED: | ||
| child = textwrap.dedent(""" |
There was a problem hiding this comment.
I'd also get rid of the double-subprocess indirectly here. If we want to invoke a bunch of Python code with different Python flags, we can put those flags into the test parametrization. Additionally, a chunk of Python in a string is not lintable, and the coverage is not getting measured. It should definitely live in a Python module as a first-class citizen.
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
What do these changes do?
Fixes another race condition seen in https://gist.github.com/devdanzin/fa00e03ef041c030660f083116a7e1b6#7-repr-race--md_repr Item 7.
Are there changes in behavior for the user?
Related issue number
#1321
Checklist