Skip to content

BUG: Fix DeprecationWarning in python 3.8 #14143

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
merged 1 commit into from
Jul 28, 2019
Merged

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Jul 28, 2019

Due to implicit conversion of int. Since total_seconds returns a python float, its easiest to convert to a C float and do the int conversion there

Fixes gh-14077

…to int

Since `total_seconds` returns a python `float`, its easiest to convert to a C float and do the int conversion there

Fixes numpygh-14077
@eric-wieser eric-wieser added 00 - Bug 09 - Backport-Candidate PRs tagged should be backported component: numpy.datetime64 (and timedelta64) labels Jul 28, 2019
@charris charris modified the milestones: 1.17.0 release, 1.17.1 release Jul 28, 2019
/* Rounding here is no worse than the integer division below.
* Only whole minute offsets are supported by numpy anyway.
*/
seconds_offset = (int)PyFloat_AsDouble(tmp);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, timezone offset in seconds should be safe in an int.

@charris charris merged commit 608329a into numpy:master Jul 28, 2019
@charris
Copy link
Member

charris commented Jul 28, 2019

Thanks Eric.

@charris charris changed the title BUG: Fix DeprecationWarning in python 3.8 due to implicit conversion to int BUG: Fix DeprecationWarning in python 3.8 Jul 29, 2019
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 29, 2019
@charris charris removed this from the 1.17.1 release milestone Jul 29, 2019
@eric-wieser eric-wieser deleted the fix-14077 branch September 14, 2019 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python 3.8b2 and TestDatetime64Timezone, too many warnings.
2 participants