diff options
author | Victor Stinner <vstinner@python.org> | 2020-01-30 08:56:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-30 08:56:40 (GMT) |
commit | c38fd0df2b4cbc1cc906d8dfe23f63b67cd6965f (patch) | |
tree | bf4258c96731f8c0e1fbc525abd27514308300b2 | |
parent | 2bf127d97bd1d60ead7c20d429b0c61ef61fc554 (diff) | |
download | cpython-c38fd0df2b4cbc1cc906d8dfe23f63b67cd6965f.zip cpython-c38fd0df2b4cbc1cc906d8dfe23f63b67cd6965f.tar.gz cpython-c38fd0df2b4cbc1cc906d8dfe23f63b67cd6965f.tar.bz2 |
bpo-39353: binascii.crc_hqx() is no longer deprecated (GH-18276)
The binascii.crc_hqx() function is no longer deprecated.
-rw-r--r-- | Doc/library/binascii.rst | 2 | ||||
-rw-r--r-- | Doc/whatsnew/3.9.rst | 1 | ||||
-rw-r--r-- | Lib/binhex.py | 6 | ||||
-rw-r--r-- | Lib/test/test_binascii.py | 3 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Library/2020-01-30-09-07-16.bpo-39353.wTl9hc.rst | 1 | ||||
-rw-r--r-- | Modules/binascii.c | 5 |
6 files changed, 3 insertions, 15 deletions
diff --git a/Doc/library/binascii.rst b/Doc/library/binascii.rst index aa2a270..2c0c1bc 100644 --- a/Doc/library/binascii.rst +++ b/Doc/library/binascii.rst @@ -132,8 +132,6 @@ The :mod:`binascii` module defines the following functions: *x*:sup:`16` + *x*:sup:`12` + *x*:sup:`5` + 1, often represented as 0x1021. This CRC is used in the binhex4 format. - .. deprecated:: 3.9 - .. function:: crc32(data[, value]) diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index a4c4266..c8f4077 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -379,7 +379,6 @@ Deprecated * :func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx` * :func:`~binascii.rlecode_hqx`, :func:`~binascii.rledecode_hqx` - * :func:`~binascii.crc_hqx` (Contributed by Victor Stinner in :issue:`39353`.) diff --git a/Lib/binhex.py b/Lib/binhex.py index 6ff38dd..9559f46 100644 --- a/Lib/binhex.py +++ b/Lib/binhex.py @@ -200,8 +200,7 @@ class BinHex: self._writecrc() def _write(self, data): - with _ignore_deprecation_warning(): - self.crc = binascii.crc_hqx(data, self.crc) + self.crc = binascii.crc_hqx(data, self.crc) self.ofp.write(data) def _writecrc(self): @@ -396,8 +395,7 @@ class HexBin: def _read(self, len): data = self.ifp.read(len) - with _ignore_deprecation_warning(): - self.crc = binascii.crc_hqx(data, self.crc) + self.crc = binascii.crc_hqx(data, self.crc) return data def _checkcrc(self): diff --git a/Lib/test/test_binascii.py b/Lib/test/test_binascii.py index 649edbe..4532795 100644 --- a/Lib/test/test_binascii.py +++ b/Lib/test/test_binascii.py @@ -435,9 +435,6 @@ class BinASCIITest(unittest.TestCase): with self.assertWarns(DeprecationWarning): self.assertEqual(binascii.rledecode_hqx(b'a\x90\n'), b'a' * 10) - with self.assertWarns(DeprecationWarning): - self.assertEqual(binascii.crc_hqx(b'abc', 0), 40406) - class ArrayBinASCIITest(BinASCIITest): def type2test(self, s): diff --git a/Misc/NEWS.d/next/Library/2020-01-30-09-07-16.bpo-39353.wTl9hc.rst b/Misc/NEWS.d/next/Library/2020-01-30-09-07-16.bpo-39353.wTl9hc.rst new file mode 100644 index 0000000..b6db7c5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-01-30-09-07-16.bpo-39353.wTl9hc.rst @@ -0,0 +1 @@ +The :func:`binascii.crc_hqx` function is no longer deprecated. diff --git a/Modules/binascii.c b/Modules/binascii.c index c6da3e0..e428b0d 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -965,11 +965,6 @@ static PyObject * binascii_crc_hqx_impl(PyObject *module, Py_buffer *data, unsigned int crc) /*[clinic end generated code: output=2fde213d0f547a98 input=56237755370a951c]*/ { - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "binascii.crc_hqx() is deprecated", 1) < 0) { - return NULL; - } - const unsigned char *bin_data; Py_ssize_t len; |