1. Matt Joiner
  2. gthread

Commits

Matt Joiner  committed d2320ae

Fix dummy Channel, and for Python 2.x

  • Participants
  • Parent commits 1084dc9
  • Branches default

Comments (0)

Files changed (1)

File dummy_gthread.py

View file
-import queue
+try:
+    import queue
+except ImportError:
+    import Queue as queue
 from threading import Lock, Condition
 from time import sleep
 
                 self._not_full.wait()
             self._items.append(item)
             self._not_empty.notify()
+
+    def __enter__(self):
+        return self
+
+    def __exit__(self, *args):
+        self.close()