-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-28254: _posixsubprocess uses PyGC_Enable/PyGC_Disable #25693
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
Conversation
👀 |
Thanks. I fixed test_subprocess. |
Actually, I think much of this could already have been saved before by using the ID-string API. But still, this is just so much better. |
I don't think that using cached interned strings is really relevant here, spawning a subprocess takes a few milliseconds, we are far from nanoseconds avoided thanks to the cache. Anyway, it's now gone ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay, thanks for the cleanup!
del gc.isenabled # force an AttributeError | ||
self.assertRaises(AttributeError, subprocess.Popen, | ||
[sys.executable, '-c', ''], | ||
preexec_fn=lambda: None) | ||
finally: | ||
gc.disable = orig_gc_disable | ||
gc.isenabled = orig_gc_isenabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saving and restoring these two with the try: finally: seems no longer necessary now that they're not being monkeypatched out to cause errors. (harmless, but anyone reading this will wonder why...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you're right: I created #25709
https://bugs.python.org/issue28254