[2.7] bpo-31848: Fix broken error handling in Aifc_read.initfp() when the SSND chunk is not found (GH-5240) (GH-5781)
Initialize self._ssnd_chunk so that aifc.Error is raised as intended,
not AttributeError.
(cherry picked from commit 80d20b918bd8a882043c493a7f958333ecb41727)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
diff --git a/Lib/aifc.py b/Lib/aifc.py
index e678327..981f801 100644
--- a/Lib/aifc.py
+++ b/Lib/aifc.py
@@ -308,6 +308,7 @@
else:
raise Error, 'not an AIFF or AIFF-C file'
self._comm_chunk_read = 0
+ self._ssnd_chunk = None
while 1:
self._ssnd_seek_needed = 1
try: