-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-45915: use fcntl(fd, F_GETFD) in is_valid_fd() (GH-29821) #29821
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
Signed-off-by: Christian Heimes <[email protected]>
Python/pylifecycle.c
Outdated
@@ -2139,6 +2145,12 @@ is_valid_fd(int fd) | |||
if (fd < 0) { | |||
return 0; | |||
} | |||
#ifdef F_GETFD |
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.
macOS also supports F_GETFD
flag also.
On my macOS, all tests are passed with changes to use F_GETFD
.
bpo-30225: On macOS Tiger, when stdout is redirected to a pipe and the other
macOS Tiger is 10.4, we provide installers for 10.9+ nowadays.
https://www.python.org/downloads/release/python-3100/
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.
So I would like to suggest changing the code to support macOS also.
c93fa66
to
70ca98b
Compare
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.
lgtm
Why restricting the change to a few plaforms if it's faster? |
I have no means to test this on other platforms. I know it works on Linux and Dong-hee told me it works on macOS. |
Signed-off-by: Christian Heimes [email protected]
https://bugs.python.org/issue45915