Skip to content

Commit 9cc998f

Browse files
committed
Remove lzma version constants
Signed-off-by: Chien Wong <m@xv97.com>
1 parent 78e7d9a commit 9cc998f

5 files changed

Lines changed: 1 addition & 66 deletions

File tree

Doc/library/lzma.rst

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -335,39 +335,6 @@ Miscellaneous
335335
feature set.
336336

337337

338-
Information about the version of the lzma library in use is available through
339-
the following constants:
340-
341-
342-
.. data:: LZMA_VERSION
343-
.. data:: LZMA_VERSION_STRING
344-
345-
The version of the lzma C library actually loaded at runtime, in both
346-
integer and string forms.
347-
348-
.. versionadded:: 3.15
349-
350-
.. data:: LZMA_HEADER_VERSION
351-
.. data:: LZMA_HEADER_VERSION_STRING
352-
353-
The version of the lzma library that was used for building the module, in
354-
both integer and string forms. This may be different from the lzma library
355-
actually used at runtime.
356-
357-
.. versionadded:: 3.15
358-
359-
The version number and string formats are as defined in by C library. The
360-
integer is represented in decimal digits as ``jmmmppps`` where ``j`` is the
361-
major version, ``mmm`` is the minor version, ``ppp`` is the patch level, and
362-
``s`` is the "stability indicator" (2 means stable)::
363-
364-
>>> import lzma
365-
>>> lzma.LZMA_VERSION
366-
50020052
367-
>>> lzma.LZMA_VERSION_STRING
368-
'5.2.5'
369-
370-
371338
.. _filter-chain-specs:
372339

373340
Specifying custom filter chains

Lib/lzma.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
"FILTER_ARM", "FILTER_ARMTHUMB", "FILTER_POWERPC", "FILTER_SPARC",
1616
"FILTER_ARM64", "FILTER_RISCV",
1717
"FORMAT_AUTO", "FORMAT_XZ", "FORMAT_ALONE", "FORMAT_RAW",
18-
"LZMA_HEADER_VERSION", "LZMA_HEADER_VERSION_STRING",
19-
"LZMA_VERSION", "LZMA_VERSION_STRING",
2018
"MF_HC3", "MF_HC4", "MF_BT2", "MF_BT3", "MF_BT4",
2119
"MODE_FAST", "MODE_NORMAL", "PRESET_DEFAULT", "PRESET_EXTREME",
2220

Lib/test/test_lzma.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,6 @@ def test_riscv_filter_constant_exists(self):
389389
def test_arm64_filter_constant_exists(self):
390390
self.assertTrue(lzma.FILTER_ARM64)
391391

392-
def test_lzma_header_versions(self):
393-
self.assertIsInstance(lzma.LZMA_HEADER_VERSION_STRING, str)
394-
self.assertGreater(lzma.LZMA_HEADER_VERSION, 0)
395-
396-
def test_lzma_versions(self):
397-
self.assertIsInstance(lzma.LZMA_VERSION_STRING, str)
398-
self.assertGreater(lzma.LZMA_VERSION, 0)
399-
400392

401393
class CompressDecompressFunctionTestCase(unittest.TestCase):
402394

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
:mod:`lzma` gains C library version info constants and adds constants to
2-
support the newer BCJ filters for ARM64 and RISC-V.
1+
:mod:`lzma` adds constants to support the newer BCJ filters for ARM64 and RISC-V.

Modules/_lzmamodule.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,27 +1603,6 @@ lzma_exec(PyObject *module)
16031603
return -1;
16041604
}
16051605

1606-
if (PyModule_AddStringConstant(
1607-
module, "LZMA_HEADER_VERSION_STRING",
1608-
LZMA_VERSION_STRING) < 0) {
1609-
return -1;
1610-
}
1611-
if (PyModule_AddStringConstant(
1612-
module, "LZMA_VERSION_STRING",
1613-
lzma_version_string()) < 0) {
1614-
return -1;
1615-
}
1616-
PyObject *uint32_obj = PyLong_FromUnsignedLong(LZMA_VERSION);
1617-
if (PyModule_AddObject(module, "LZMA_HEADER_VERSION", uint32_obj) < 0) {
1618-
Py_XDECREF(uint32_obj);
1619-
return -1;
1620-
}
1621-
uint32_obj = PyLong_FromUnsignedLong(lzma_version_number());
1622-
if (PyModule_AddObject(module, "LZMA_VERSION", uint32_obj) < 0) {
1623-
Py_XDECREF(uint32_obj);
1624-
return -1;
1625-
}
1626-
16271606
return 0;
16281607
}
16291608

0 commit comments

Comments
 (0)