Fix Python 3.9 compatibility (#1792055)
This commit is contained in:
parent
5f013c0024
commit
d017f13c95
2 changed files with 35 additions and 1 deletions
28
0005-fix-python-3.9-compatibility.patch
Normal file
28
0005-fix-python-3.9-compatibility.patch
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
diff --git a/blosc/toplevel.py b/blosc/toplevel.py
|
||||
index 94cf4af..2fa2c49 100644
|
||||
--- a/blosc/toplevel.py
|
||||
+++ b/blosc/toplevel.py
|
||||
@@ -435,9 +435,9 @@ def compress(bytesobj, typesize=8, clevel=9, shuffle=blosc.SHUFFLE,
|
||||
Examples
|
||||
--------
|
||||
|
||||
- >>> import array
|
||||
+ >>> import array, sys
|
||||
>>> a = array.array('i', range(1000*1000))
|
||||
- >>> a_bytesobj = a.tostring()
|
||||
+ >>> a_bytesobj = a.tobytes() if sys.version_info >= (3, 0, 0) else a.tostring()
|
||||
>>> c_bytesobj = blosc.compress(a_bytesobj, typesize=4)
|
||||
>>> len(c_bytesobj) < len(a_bytesobj)
|
||||
True
|
||||
@@ -574,9 +574,9 @@ def decompress(bytesobj, as_bytearray=False):
|
||||
Examples
|
||||
--------
|
||||
|
||||
- >>> import array
|
||||
+ >>> import array, sys
|
||||
>>> a = array.array('i', range(1000*1000))
|
||||
- >>> a_bytesobj = a.tostring()
|
||||
+ >>> a_bytesobj = a.tobytes() if sys.version_info >= (3, 0, 0) else a.tostring()
|
||||
>>> c_bytesobj = blosc.compress(a_bytesobj, typesize=4)
|
||||
>>> a_bytesobj2 = blosc.decompress(c_bytesobj)
|
||||
>>> a_bytesobj == a_bytesobj2
|
||||
Loading…
Add table
Add a link
Reference in a new issue