| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| pipesize_default = fcntl.fcntl(test_pipe_w, fcntl.F_GETPIPE_SZ) | ||
| pipesize = pipesize_default // 2 # A new value to detect change. | ||
| if pipesize < 512: # the POSIX minimum | ||
| minimum_pipe_size = os.sysconf('SC_PAGESIZE') # There's a check that attempts to skip the tests if the pipe capacity is 512 bytes, but that's less than the smallest page size on x86. |
There was a problem hiding this comment.
Please follow PEP8: https://peps.python.org/pep-0008/#maximum-line-length
Sorry, something went wrong.
| os.close(test_pipe_w) | ||
| pipesize = pipesize_default // 2 | ||
| if pipesize < 512: # the POSIX minimum | ||
| minimum_pipe_size = os.sysconf('SC_PAGESIZE') # There's a check that attempts to skip the tests if the pipe capacity is 512 bytes, but that's less than the smallest page size on x86. |
There was a problem hiding this comment.
ditto
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request. |
Sorry, something went wrong.
| pipesize_default = fcntl.fcntl(test_pipe_w, fcntl.F_GETPIPE_SZ) | ||
| pipesize = pipesize_default // 2 # A new value to detect change. | ||
| if pipesize < 512: # the POSIX minimum | ||
| minimum_pipe_size = os.sysconf('SC_PAGESIZE') # There's a check that attempts to skip the tests if the pipe capacity is 512 bytes, but that's less than the smallest page size on x86. |
There was a problem hiding this comment.
There's a check that attempts to skip the tests if the pipe capacity is 512 bytes, but that's less than the smallest page size on x86.
You need to describe why the os.sysconf('SC_PAGESIZE') is needed rather than describe the issue itself.
Sorry, something went wrong.
| hasattr(fcntl, "F_SETPIPE_SZ") and hasattr(fcntl, "F_GETPIPE_SZ"), | ||
| "F_SETPIPE_SZ and F_GETPIPE_SZ are not available on all platforms.") | ||
| def test_fcntl_f_pipesize(self): | ||
| resource = import_module('resource') |
There was a problem hiding this comment.
Why not just using import resource?
Sorry, something went wrong.
There was a problem hiding this comment.
Oh that's right, I'll fix it.
Sorry, something went wrong.
| import struct | ||
| import sys | ||
| import unittest | ||
| import resource |
There was a problem hiding this comment.
@hyeongyun0916 resource module looks like not available on Windows platform.
Sorry, something went wrong.
There was a problem hiding this comment.
I'll add a function to the test support.
Sorry, something went wrong.
| interval = minimum_interval | ||
| return sys.setswitchinterval(interval) | ||
|
|
||
| def get_pagesize(): |
There was a problem hiding this comment.
I'll change https://github.com/python/cpython/blob/main/Lib/test/memory_watchdog.py#L13 to get_pagesize in other pr.
Sorry, something went wrong.
| import sys | ||
| import unittest | ||
| from test import support | ||
| from test.support import verbose, cpython_only |
There was a problem hiding this comment.
| from test.support import verbose, cpython_only | |
| from test.support import verbose, cpython_only, get_pagesize |
Sorry, something went wrong.
| import struct | ||
| import sys | ||
| import unittest | ||
| from test import support |
There was a problem hiding this comment.
| from test import support |
Sorry, something went wrong.
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
There was a problem hiding this comment.
lgtm!
Thanks for the hardwork!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
skip fcntl when pipesize is smaller than pagesize