Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
bpo-31904: Add time module support for VxWorks RTOS#12305
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
8 commits Select commit Hold shift + click to select a range
922303f support time module for VxWorks
pxinwr 58b990f Fix test_time failures for VxWorks
pxinwr 5899df0 add news file
pxinwr 219af22 report OverflowError for 2038 issue on VxWorks
pxinwr 0d2e172 state time.clock() is not supported for VxWorks in docs
pxinwr 090f73c Merge remote-tracking branch 'upstream/master' into fix-issue-31904-time
pxinwr 18da015 rephrase VxWorks not supporting clock()
pxinwr a30457d use clocks.append to avoid code duplication
pxinwr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions 1 Misc/NEWS.d/next/Library/2019-03-13-16-48-42.bpo-31904.9sjd38.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add time module support and fix test_time faiures for VxWorks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -145,7 +145,7 @@ perf_counter(_Py_clock_info_t *info) | ||
| return _PyFloat_FromPyTime(t); | ||
| } | ||
| #if defined(MS_WINDOWS) || defined(HAVE_CLOCK) | ||
| #if (defined(MS_WINDOWS) || defined(HAVE_CLOCK)) && !defined(__VXWORKS__) | ||
| #define PYCLOCK | ||
| static PyObject* | ||
| pyclock(_Py_clock_info_t *info) | ||
| @@ -765,7 +765,7 @@ time_strftime(PyObject *self, PyObject *args) | ||
| return NULL; | ||
| } | ||
| #if defined(_MSC_VER) || (defined(__sun) && defined(__SVR4)) || defined(_AIX) | ||
| #if defined(_MSC_VER) || (defined(__sun) && defined(__SVR4)) || defined(_AIX) || defined(__VXWORKS__) | ||
| if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900){ | ||
| PyErr_SetString(PyExc_ValueError, | ||
| "strftime() requires year in [1; 9999]"); | ||
| @@ -1001,18 +1001,21 @@ time_mktime(PyObject *self, PyObject *tm_tuple) | ||
| return NULL; | ||
| } | ||
| #ifdef _AIX | ||
| #if defined(_AIX) || (defined(__VXWORKS__) && !defined(_WRS_CONFIG_LP64)) | ||
pxinwr marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| /* bpo-19748: AIX mktime() valid range is 00:00:00 UTC, January 1, 1970 | ||
| to 03:14:07 UTC, January 19, 2038. Thanks to the workaround below, | ||
| it is possible to support years in range [1902; 2037] */ | ||
| if (tm.tm_year < 2 || tm.tm_year > 137){ | ||
| /* bpo-19748: On AIX, mktime() does not report overflow error | ||
| for timestamp < -2^31 or timestamp > 2**31-1. */ | ||
| for timestamp < -2^31 or timestamp > 2**31-1. VxWorks has the | ||
| same issue when working in 32 bit mode. */ | ||
| PyErr_SetString(PyExc_OverflowError, | ||
| "mktime argument out of range"); | ||
| return NULL; | ||
| } | ||
| #endif | ||
| #ifdef _AIX | ||
| /* bpo-34373: AIX mktime() has an integer overflow for years in range | ||
| [1902; 1969]. Workaround the issue by using a year greater or equal than | ||
| 1970 (tm_year >= 70): mktime() behaves correctly in that case | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.