mirror of https://github.com/python/cpython.git
Rename lzma.check_is_supported() to is_check_supported() to avoid grammatical confusion.
This commit is contained in:
parent
f55b329edc
commit
bc459bb484
|
@ -225,7 +225,7 @@ Compressing and decompressing data in memory
|
||||||
Miscellaneous
|
Miscellaneous
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
.. function:: check_is_supported(check)
|
.. function:: is_check_supported(check)
|
||||||
|
|
||||||
Returns true if the given integrity check is supported on this system.
|
Returns true if the given integrity check is supported on this system.
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
"MODE_FAST", "MODE_NORMAL", "PRESET_DEFAULT", "PRESET_EXTREME",
|
"MODE_FAST", "MODE_NORMAL", "PRESET_DEFAULT", "PRESET_EXTREME",
|
||||||
|
|
||||||
"LZMACompressor", "LZMADecompressor", "LZMAFile", "LZMAError",
|
"LZMACompressor", "LZMADecompressor", "LZMAFile", "LZMAError",
|
||||||
"compress", "decompress", "check_is_supported",
|
"compress", "decompress", "is_check_supported",
|
||||||
"encode_filter_properties", "decode_filter_properties",
|
"encode_filter_properties", "decode_filter_properties",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -935,14 +935,14 @@ class MiscellaneousTestCase(unittest.TestCase):
|
||||||
def test_is_check_supported(self):
|
def test_is_check_supported(self):
|
||||||
# CHECK_NONE and CHECK_CRC32 should always be supported,
|
# CHECK_NONE and CHECK_CRC32 should always be supported,
|
||||||
# regardless of the options liblzma was compiled with.
|
# regardless of the options liblzma was compiled with.
|
||||||
self.assertTrue(lzma.check_is_supported(lzma.CHECK_NONE))
|
self.assertTrue(lzma.is_check_supported(lzma.CHECK_NONE))
|
||||||
self.assertTrue(lzma.check_is_supported(lzma.CHECK_CRC32))
|
self.assertTrue(lzma.is_check_supported(lzma.CHECK_CRC32))
|
||||||
|
|
||||||
# The .xz format spec cannot store check IDs above this value.
|
# The .xz format spec cannot store check IDs above this value.
|
||||||
self.assertFalse(lzma.check_is_supported(lzma.CHECK_ID_MAX + 1))
|
self.assertFalse(lzma.is_check_supported(lzma.CHECK_ID_MAX + 1))
|
||||||
|
|
||||||
# This value should not be a valid check ID.
|
# This value should not be a valid check ID.
|
||||||
self.assertFalse(lzma.check_is_supported(lzma.CHECK_UNKNOWN))
|
self.assertFalse(lzma.is_check_supported(lzma.CHECK_UNKNOWN))
|
||||||
|
|
||||||
def test_encode_filter_properties(self):
|
def test_encode_filter_properties(self):
|
||||||
with self.assertRaises(TypeError):
|
with self.assertRaises(TypeError):
|
||||||
|
|
|
@ -1075,19 +1075,19 @@ static PyTypeObject Decompressor_type = {
|
||||||
|
|
||||||
/* Module-level functions. */
|
/* Module-level functions. */
|
||||||
|
|
||||||
PyDoc_STRVAR(check_is_supported_doc,
|
PyDoc_STRVAR(is_check_supported_doc,
|
||||||
"check_is_supported(check_id) -> bool\n"
|
"is_check_supported(check_id) -> bool\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Test whether the given integrity check is supported.\n"
|
"Test whether the given integrity check is supported.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Always returns True for CHECK_NONE and CHECK_CRC32.\n");
|
"Always returns True for CHECK_NONE and CHECK_CRC32.\n");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
check_is_supported(PyObject *self, PyObject *args)
|
is_check_supported(PyObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
int check_id;
|
int check_id;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "i:check_is_supported", &check_id))
|
if (!PyArg_ParseTuple(args, "i:is_check_supported", &check_id))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return PyBool_FromLong(lzma_check_is_supported(check_id));
|
return PyBool_FromLong(lzma_check_is_supported(check_id));
|
||||||
|
@ -1182,8 +1182,8 @@ decode_filter_properties(PyObject *self, PyObject *args)
|
||||||
/* Module initialization. */
|
/* Module initialization. */
|
||||||
|
|
||||||
static PyMethodDef module_methods[] = {
|
static PyMethodDef module_methods[] = {
|
||||||
{"check_is_supported", (PyCFunction)check_is_supported,
|
{"is_check_supported", (PyCFunction)is_check_supported,
|
||||||
METH_VARARGS, check_is_supported_doc},
|
METH_VARARGS, is_check_supported_doc},
|
||||||
{"encode_filter_properties", (PyCFunction)encode_filter_properties,
|
{"encode_filter_properties", (PyCFunction)encode_filter_properties,
|
||||||
METH_VARARGS, encode_filter_properties_doc},
|
METH_VARARGS, encode_filter_properties_doc},
|
||||||
{"decode_filter_properties", (PyCFunction)decode_filter_properties,
|
{"decode_filter_properties", (PyCFunction)decode_filter_properties,
|
||||||
|
|
Loading…
Reference in New Issue