Skip to content

bpo-29110: add test for Aifc_write. #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 26, 2017
Merged

Conversation

methane
Copy link
Member

@methane methane commented Feb 25, 2017

Lib/aifc.py Outdated
@@ -371,7 +371,7 @@ def rewind(self):
self._soundpos = 0

def close(self):
file = self._file
file = getattr(self, '_file')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is easier and more reliable to set a class attribute _file = None. This also helps when __del__ is called after clearing the builtins module. This is common idiom.

Lib/aifc.py Outdated
@@ -303,6 +303,8 @@ class Aifc_read:
# _ssnd_chunk -- instantiation of a chunk class for the SSND chunk
# _framesize -- size of one frame in the file

_file = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment like in subprocess.py, tempfile.py, zipfile.py?

@methane methane merged commit 5dc33ee into python:master Feb 26, 2017
@methane methane deleted the aifc-test-write branch February 26, 2017 12:12
methane added a commit to methane/cpython that referenced this pull request Feb 26, 2017
methane added a commit to methane/cpython that referenced this pull request Feb 26, 2017
methane added a commit that referenced this pull request Feb 26, 2017
(cherry picked from commit 03f68b6) (GH-162)
(cherry picked from commit 5dc33ee) (GH-293)
methane added a commit that referenced this pull request Feb 26, 2017
(cherry picked from commit 03f68b6) (GH-162)
(cherry picked from commit 5dc33ee) (GH-293)
jaraco pushed a commit that referenced this pull request Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants