@@ -41,15 +41,14 @@ import pandas._libs.lib as lib
41
41
from pandas._libs.khash cimport (
42
42
khiter_t,
43
43
kh_str_t, kh_init_str, kh_put_str, kh_exist_str,
44
- kh_get_str, kh_destroy_str, kh_resize_str,
44
+ kh_get_str, kh_destroy_str,
45
45
kh_float64_t, kh_get_float64, kh_destroy_float64,
46
46
kh_put_float64, kh_init_float64, kh_resize_float64,
47
47
kh_strbox_t, kh_put_strbox, kh_get_strbox, kh_init_strbox,
48
48
kh_destroy_strbox,
49
49
kh_str_starts_t, kh_put_str_starts_item, kh_init_str_starts,
50
50
kh_get_str_starts_item, kh_destroy_str_starts, kh_resize_str_starts)
51
51
52
- import pandas.compat as compat
53
52
from pandas.core.dtypes.common import (
54
53
is_categorical_dtype,
55
54
is_integer_dtype, is_float_dtype,
@@ -477,14 +476,19 @@ cdef class TextReader:
477
476
478
477
self .verbose = verbose
479
478
self .low_memory = low_memory
480
- self .parser.double_converter_nogil = xstrtod
481
- self .parser.double_converter_withgil = NULL
482
- if float_precision == ' high' :
483
- self .parser.double_converter_nogil = precise_xstrtod
484
- self .parser.double_converter_withgil = NULL
485
- elif float_precision == ' round_trip' : # avoid gh-15140
479
+
480
+ if float_precision == " round_trip" :
481
+ # see gh-15140
482
+ #
483
+ # Our current roundtrip implementation requires the GIL.
486
484
self .parser.double_converter_nogil = NULL
487
485
self .parser.double_converter_withgil = round_trip
486
+ elif float_precision == " high" :
487
+ self .parser.double_converter_withgil = NULL
488
+ self .parser.double_converter_nogil = precise_xstrtod
489
+ else :
490
+ self .parser.double_converter_withgil = NULL
491
+ self .parser.double_converter_nogil = xstrtod
488
492
489
493
if isinstance (dtype, dict ):
490
494
dtype = {k: pandas_dtype(dtype[k])
0 commit comments