diff pytouhou/utils/bitstream.py @ 97:ac2e5e1c2c3c

Refactor \o/
author Thibaut Girka <thib@sitedethib.com>
date Sun, 04 Sep 2011 23:50:00 +0200
parents ab826bc29aa2
children
line wrap: on
line diff
--- a/pytouhou/utils/bitstream.py
+++ b/pytouhou/utils/bitstream.py
@@ -19,6 +19,14 @@ class BitStream(object):
         self.byte = 0
 
 
+    def __enter__(self):
+        return self
+
+
+    def __exit__(self, type, value, traceback):
+        return self.io.__exit__(type, value, traceback)
+
+
     def seek(self, offset, whence=0):
         self.io.seek(offset, whence)
         self.byte = 0