summaryrefslogtreecommitdiffstats
path: root/Lib/wave.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-07-31 19:54:18 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-07-31 19:54:18 (GMT)
commitc27cd71cd71e5b3f464f6994e2a73f201eb430ca (patch)
treeb973bb782096772fc8a38a0c3bd534acc867c10a /Lib/wave.py
parent5c30a75722f1fb42f4e49dcc5dd30d90d7717086 (diff)
parentc91d5eea106d191e931f953bdbdb1db25e051767 (diff)
downloadcpython-c27cd71cd71e5b3f464f6994e2a73f201eb430ca.zip
cpython-c27cd71cd71e5b3f464f6994e2a73f201eb430ca.tar.gz
cpython-c27cd71cd71e5b3f464f6994e2a73f201eb430ca.tar.bz2
Merge
Diffstat (limited to 'Lib/wave.py')
-rw-r--r--Lib/wave.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/wave.py b/Lib/wave.py
index ea410c1..695a4be 100644
--- a/Lib/wave.py
+++ b/Lib/wave.py
@@ -167,6 +167,13 @@ class Wave_read:
def __del__(self):
self.close()
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *args):
+ self.close()
+
#
# User visible methods.
#
@@ -323,6 +330,12 @@ class Wave_write:
def __del__(self):
self.close()
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *args):
+ self.close()
+
#
# User visible methods.
#