From 7e3183ef160522e4c7cb41ac2c78690a343bf76a Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Mon, 12 Jun 2023 12:30:52 +0300 Subject: [PATCH] Update chunk from Python 3.11 --- Lib/chunk.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/chunk.py b/Lib/chunk.py index d94dd3980..618781efd 100644 --- a/Lib/chunk.py +++ b/Lib/chunk.py @@ -48,6 +48,10 @@ specifies whether or not chunks are aligned on 2-byte boundaries. The default is 1, i.e. aligned. """ +import warnings + +warnings._deprecated(__name__, remove=(3, 13)) + class Chunk: def __init__(self, file, align=True, bigendian=True, inclheader=False): import struct @@ -64,7 +68,7 @@ class Chunk: try: self.chunksize = struct.unpack_from(strflag+'L', file.read(4))[0] except struct.error: - raise EOFError + raise EOFError from None if inclheader: self.chunksize = self.chunksize - 8 # subtract header self.size_read = 0