more diff-friendly disabling xz

This commit is contained in:
Jeong YunWon committed 2025-05-07 15:01:23 +09:00
1 parent a5016446f4
commit acae154f1b
3 files changed
+17 -12

No files matched your search

+9 -4
View File
@@ -392,10 +392,13 @@ class _Stream:
elif comptype == "xz":
try:
# TODO: RUSTPYTHON remove underscore
import lzma_
import lzma
except ImportError:
raise CompressionError("lzma module is not available") from None
# XXX: RUSTPYTHON; xz is not supported yet
raise CompressionError("lzma module is not available") from None
if mode == "r":
self.dbuf = b""
self.cmp = lzma.LZMADecompressor()
@@ -1924,11 +1927,13 @@ class TarFile(object):
raise ValueError("mode must be 'r', 'w' or 'x'")
try:
# TODO: RUSTPYTHON remove underscore
from lzma_ import LZMAFile, LZMAError
from lzma import LZMAFile, LZMAError
except ImportError:
raise CompressionError("lzma module is not available") from None
# XXX: RUSTPYTHON; xz is not supported yet
raise CompressionError("lzma module is not available") from None
fileobj = LZMAFile(fileobj or name, mode, preset=preset)
try:
+5 -5
View File
@@ -494,11 +494,11 @@ def requires_bz2(reason='requires bz2'):
return unittest.skipUnless(bz2, reason)
def requires_lzma(reason='requires lzma'):
# try:
# import lzma
# except ImportError:
# lzma = None
# TODO: RUSTPYTHON
try:
import lzma
except ImportError:
lzma = None
# XXX: RUSTPYTHON; xz is not supported yet
lzma = None
return unittest.skipUnless(lzma, reason)
+3 -3
View File
@@ -28,11 +28,11 @@ try:
except ImportError:
bz2 = None
try:
# TODO: RUSTPYTHON
lzma = None
# import lzma
import lzma
except ImportError:
lzma = None
# XXX: RUSTPYTHON; xz is not supported yet
lzma = None
def sha256sum(data):
return sha256(data).hexdigest()