Skip to content

Commit c38fd0d

Browse files
authored
bpo-39353: binascii.crc_hqx() is no longer deprecated (GH-18276)
The binascii.crc_hqx() function is no longer deprecated.
1 parent 2bf127d commit c38fd0d

File tree

6 files changed

+3
-15
lines changed

6 files changed

+3
-15
lines changed

Doc/library/binascii.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ The :mod:`binascii` module defines the following functions:
132132
*x*:sup:`16` + *x*:sup:`12` + *x*:sup:`5` + 1, often represented as
133133
0x1021. This CRC is used in the binhex4 format.
134134

135-
.. deprecated:: 3.9
136-
137135

138136
.. function:: crc32(data[, value])
139137

Doc/whatsnew/3.9.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ Deprecated
379379

380380
* :func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx`
381381
* :func:`~binascii.rlecode_hqx`, :func:`~binascii.rledecode_hqx`
382-
* :func:`~binascii.crc_hqx`
383382

384383
(Contributed by Victor Stinner in :issue:`39353`.)
385384

Lib/binhex.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ def _writeinfo(self, name, finfo):
200200
self._writecrc()
201201

202202
def _write(self, data):
203-
with _ignore_deprecation_warning():
204-
self.crc = binascii.crc_hqx(data, self.crc)
203+
self.crc = binascii.crc_hqx(data, self.crc)
205204
self.ofp.write(data)
206205

207206
def _writecrc(self):
@@ -396,8 +395,7 @@ def __init__(self, ifp):
396395

397396
def _read(self, len):
398397
data = self.ifp.read(len)
399-
with _ignore_deprecation_warning():
400-
self.crc = binascii.crc_hqx(data, self.crc)
398+
self.crc = binascii.crc_hqx(data, self.crc)
401399
return data
402400

403401
def _checkcrc(self):

Lib/test/test_binascii.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,6 @@ def test_deprecated_warnings(self):
435435
with self.assertWarns(DeprecationWarning):
436436
self.assertEqual(binascii.rledecode_hqx(b'a\x90\n'), b'a' * 10)
437437

438-
with self.assertWarns(DeprecationWarning):
439-
self.assertEqual(binascii.crc_hqx(b'abc', 0), 40406)
440-
441438

442439
class ArrayBinASCIITest(BinASCIITest):
443440
def type2test(self, s):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The :func:`binascii.crc_hqx` function is no longer deprecated.

Modules/binascii.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -965,11 +965,6 @@ static PyObject *
965965
binascii_crc_hqx_impl(PyObject *module, Py_buffer *data, unsigned int crc)
966966
/*[clinic end generated code: output=2fde213d0f547a98 input=56237755370a951c]*/
967967
{
968-
if (PyErr_WarnEx(PyExc_DeprecationWarning,
969-
"binascii.crc_hqx() is deprecated", 1) < 0) {
970-
return NULL;
971-
}
972-
973968
const unsigned char *bin_data;
974969
Py_ssize_t len;
975970

0 commit comments

Comments
 (0)