Skip to content

Commit d8214ea

Browse files
disable warning check on py314t
1 parent de2e68b commit d8214ea

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

pandas/_libs/internals.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ from numpy cimport (
2323
cnp.import_array()
2424

2525
from pandas._libs.algos import ensure_int64
26-
from pandas.compat import PYPY
26+
from pandas.compat import CHAINED_WARNING_DISABLED
2727
from pandas.errors import ChainedAssignmentError
2828
from pandas.errors.cow import _chained_assignment_msg
2929

@@ -1032,7 +1032,7 @@ cdef class SetitemMixin:
10321032

10331033
def __setitem__(self, key, value) -> None:
10341034
cdef bint is_unique = 0
1035-
if not PYPY:
1035+
if not CHAINED_WARNING_DISABLED:
10361036
is_unique = _is_unique_referenced_temporary(self)
10371037
if is_unique:
10381038
warnings.warn(

pandas/compat/_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
WASM = (sys.platform == "emscripten") or (platform.machine() in ["wasm32", "wasm64"])
2020
ISMUSL = "musl" in (sysconfig.get_config_var("HOST_GNU_TYPE") or "")
2121
REF_COUNT = 2
22-
CHAINED_WARNING_DISABLED = PYPY
22+
CHAINED_WARNING_DISABLED = PYPY or (PY314 and not sys._is_gil_enabled())
2323
CHAINED_WARNING_DISABLED_INPLACE_METHOD = PYPY or PY314
2424

2525

scripts/validate_unwanted_patterns.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ def _get_literal_string_prefix_len(token_string: str) -> int:
9595
return 0
9696

9797

98-
PRIVATE_FUNCTIONS_ALLOWED = {"sys._getframe"} # no known alternative
98+
PRIVATE_FUNCTIONS_ALLOWED = {
99+
"sys._getframe",
100+
"sys._is_gil_enabled",
101+
} # no known alternative
99102

100103

101104
def private_function_across_module(file_obj: IO[str]) -> Iterable[tuple[int, str]]:

0 commit comments

Comments
 (0)