Skip to content

Commit 7e3183e

Browse files
committed
Update chunk from Python 3.11
1 parent 854d3e4 commit 7e3183e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/chunk.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
default is 1, i.e. aligned.
4949
"""
5050

51+
import warnings
52+
53+
warnings._deprecated(__name__, remove=(3, 13))
54+
5155
class Chunk:
5256
def __init__(self, file, align=True, bigendian=True, inclheader=False):
5357
import struct
@@ -64,7 +68,7 @@ def __init__(self, file, align=True, bigendian=True, inclheader=False):
6468
try:
6569
self.chunksize = struct.unpack_from(strflag+'L', file.read(4))[0]
6670
except struct.error:
67-
raise EOFError
71+
raise EOFError from None
6872
if inclheader:
6973
self.chunksize = self.chunksize - 8 # subtract header
7074
self.size_read = 0

0 commit comments

Comments
 (0)