Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit296c606

Browse files
committed
Fix old Python and PyPy
1 parent76e6eac commit296c606

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

‎pythoncapi_compat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@ PyDict_SetDefaultRef(PyObject *d, PyObject *key, PyObject *default_value,
13381338
}
13391339
#endif
13401340

1341-
#if PY_VERSION_HEX < 0x030E0000
1341+
#if PY_VERSION_HEX < 0x030E0000 && PY_VERSION_HEX >= 0x03060000 && !defined(PYPY_VERSION)
13421342
typedefstructPyUnicodeWriter PyUnicodeWriter;
13431343

13441344
staticinline PyUnicodeWriter*PyUnicodeWriter_Create(void)

‎tests/test_pythoncapi_compat_cext.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,9 @@ test_get_constant(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
17241724
}
17251725

17261726

1727+
#ifPY_VERSION_HEX<0x030E0000&&PY_VERSION_HEX >=0x03060000&& !defined(PYPY_VERSION)
1728+
#defineTEST_UNICODEWRITER 1
1729+
17271730
staticPyObject*
17281731
test_unicodewriter(PyObject*Py_UNUSED(self),PyObject*Py_UNUSED(args))
17291732
{
@@ -1818,6 +1821,7 @@ test_unicodewriter_format(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args))
18181821
PyUnicodeWriter_Free(writer);
18191822
returnNULL;
18201823
}
1824+
#endif
18211825

18221826

18231827
staticstructPyMethodDefmethods[]= {
@@ -1858,8 +1862,10 @@ static struct PyMethodDef methods[] = {
18581862
{"test_time",test_time,METH_NOARGS,_Py_NULL},
18591863
#endif
18601864
{"test_get_constant",test_get_constant,METH_NOARGS,_Py_NULL},
1865+
#ifdefTEST_UNICODEWRITER
18611866
{"test_unicodewriter",test_unicodewriter,METH_NOARGS,_Py_NULL},
18621867
{"test_unicodewriter_format",test_unicodewriter_format,METH_NOARGS,_Py_NULL},
1868+
#endif
18631869
{_Py_NULL,_Py_NULL,0,_Py_NULL}
18641870
};
18651871

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp