Skip to content

Commit d3976f5

Browse files
committed
Merge pull request #8357 from amras1/new-float-conversion
Changed round_trip converter to Python converter instead of strtod
2 parents b296b9e + 52aee10 commit d3976f5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pandas/src/parser/tokenizer.c

+4
Original file line numberDiff line numberDiff line change
@@ -2292,7 +2292,11 @@ double precise_xstrtod(const char *str, char **endptr, char decimal,
22922292
double round_trip(const char *p, char **q, char decimal, char sci,
22932293
char tsep, int skip_trailing)
22942294
{
2295+
#if PY_VERSION_HEX >= 0x02070000
2296+
return PyOS_string_to_double(p, q, 0);
2297+
#else
22952298
return strtod(p, q);
2299+
#endif
22962300
}
22972301

22982302
/*

pandas/src/parser/tokenizer.h

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ See LICENSE for the license
1212
#ifndef _PARSER_COMMON_H_
1313
#define _PARSER_COMMON_H_
1414

15+
#include "Python.h"
1516
#include <stdio.h>
1617
#include <string.h>
1718
#include <stdlib.h>

0 commit comments

Comments
 (0)