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

Commitb053c89

Browse files
committed
Fix old Python and PyPy
1 parent4a87b43 commitb053c89

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
@@ -1727,6 +1727,9 @@ test_get_constant(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
17271727
}
17281728

17291729

1730+
#ifPY_VERSION_HEX<0x030E0000&&PY_VERSION_HEX >=0x03060000&& !defined(PYPY_VERSION)
1731+
#defineTEST_UNICODEWRITER 1
1732+
17301733
staticPyObject*
17311734
test_unicodewriter(PyObject*Py_UNUSED(self),PyObject*Py_UNUSED(args))
17321735
{
@@ -1821,6 +1824,7 @@ test_unicodewriter_format(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args))
18211824
PyUnicodeWriter_Free(writer);
18221825
returnNULL;
18231826
}
1827+
#endif
18241828

18251829

18261830
staticstructPyMethodDefmethods[]= {
@@ -1861,8 +1865,10 @@ static struct PyMethodDef methods[] = {
18611865
{"test_time",test_time,METH_NOARGS,_Py_NULL},
18621866
#endif
18631867
{"test_get_constant",test_get_constant,METH_NOARGS,_Py_NULL},
1868+
#ifdefTEST_UNICODEWRITER
18641869
{"test_unicodewriter",test_unicodewriter,METH_NOARGS,_Py_NULL},
18651870
{"test_unicodewriter_format",test_unicodewriter_format,METH_NOARGS,_Py_NULL},
1871+
#endif
18661872
{_Py_NULL,_Py_NULL,0,_Py_NULL}
18671873
};
18681874

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp