| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
HP-UX does not support the CLOCK_MONOTONIC identifier, and will fail to
compile:
"Python/pytime.c", line 723: error python#2020: identifier
"CLOCK_MONOTONIC" is undefined
const clockid_t clk_id = CLOCK_MONOTONIC;
Add a new section for __hpux that calls 'gethrtime()' instead of
'clock_gettime()'.
|
@haney, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @serhiy-storchaka and @abalkin to be potential reviewers. |
Sorry, something went wrong.
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, except of a minor comment.
I cannot test, so I expect that you tested your own patch :-) Are you able to build Python with this change? Does test_time pass?
Sorry, something went wrong.
| if (time == -1) { | ||
| if (raise) { | ||
| PyErr_SetFromErrno(PyExc_OSError); | ||
| return -1; |
There was a problem hiding this comment.
You remove remove this duplicated return.
Sorry, something went wrong.
There was a problem hiding this comment.
Doh. Thanks.
Sorry, something went wrong.
|
Yes, I successfully built the Python library and ran the test suite on HPUX after applying this patch. It looks like test_time is failing. I'll dig into it and see if the failure is related to this change or other issues on HPUX (I'm seeing 40 tests fail). I'll update this pull request when I have additional information. Thanks for prompting that double-check on the state of the test. |
Sorry, something went wrong.
|
The failing tests in test_time appear to be unrelated to this change, and I expect were pre-existing failures on this platform. The test output I'm seeing follows: ======================================================================
FAIL: test_4dyear (test.test_time.TestStrftime4dyear)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/amd/devco/haney/git/cpython/Lib/test/test_time.py", line 557, in test_4dyear
self.test_year('%04d', func=year4d)
File "/amd/devco/haney/git/cpython/Lib/test/test_time.py", line 587, in test_year
self.assertEqual(func(1), fmt % 1)
AssertionError: '' != '0001'
+ 0001
======================================================================
FAIL: test_large_year (test.test_time.TestStrftime4dyear)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/amd/devco/haney/git/cpython/Lib/test/test_time.py", line 572, in test_large_year
return super().test_large_year()
File "/amd/devco/haney/git/cpython/Lib/test/test_time.py", line 595, in test_large_year
self.assertEqual(self.yearstr(12345), '12345')
AssertionError: '' != '12345'
+ 12345
======================================================================
FAIL: test_negative (test.test_time.TestStrftime4dyear)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/amd/devco/haney/git/cpython/Lib/test/test_time.py", line 576, in test_negative
return super().test_negative()
File "/amd/devco/haney/git/cpython/Lib/test/test_time.py", line 601, in test_negative
self.assertEqual(self.yearstr(-1), self._format % -1)
AssertionError: '' != '-1'
+ -1
======================================================================
FAIL: test_year (test.test_time.TestStrftime4dyear)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/amd/devco/haney/git/cpython/Lib/test/test_time.py", line 587, in test_year
self.assertEqual(func(1), fmt % 1)
AssertionError: '' != '1'
+ 1
======================================================================
FAIL: test_default_values_for_zero (test.test_time.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/amd/devco/haney/git/cpython/Lib/test/test_time.py", line 210, in test_default_values_for_zero
self.assertEqual(expected, result)
AssertionError: '2000 01 01 00 00 00 1 001' != ''
- 2000 01 01 00 00 00 1 001
+
======================================================================
FAIL: test_strptime (test.test_time.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/amd/devco/haney/git/cpython/Lib/test/test_time.py", line 222, in test_strptime
time.strptime(strf_output, format)
ValueError: time data '' does not match format '%d'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/amd/devco/haney/git/cpython/Lib/test/test_time.py", line 225, in test_strptime
(format, strf_output))
AssertionError: conversion specifier '%d' failed with '' input.
----------------------------------------------------------------------
Since the tests that are failing all appear to be related to formatting time objects, I don't think they are related to this change. test_monotonic, which I would expect to be directly related to this change, is passing. |
Sorry, something went wrong.
|
test_time failures seem to be unrelated to the monotonic clock. Let's do that in a new PR. Thanks @haney for fixing this HP-UX issue! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
HP-UX does not support the CLOCK_MONOTONIC identifier, and will fail to
compile:
"Python/pytime.c", line 723: error #2020: identifier "CLOCK_MONOTONIC" is undefined const clockid_t clk_id = CLOCK_MONOTONIC;Add a new section for __hpux that calls gethrtime() instead of
clock_gettime().