mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Raise statement normalization in Lib/test/.
This commit is contained in:
parent
e0281cab81
commit
3add4d78ff
47 changed files with 218 additions and 218 deletions
|
@ -87,17 +87,17 @@ class FailingQueue(Queue.Queue):
|
|||
def _put(self, item):
|
||||
if self.fail_next_put:
|
||||
self.fail_next_put = False
|
||||
raise FailingQueueException, "You Lose"
|
||||
raise FailingQueueException("You Lose")
|
||||
return Queue.Queue._put(self, item)
|
||||
def _get(self):
|
||||
if self.fail_next_get:
|
||||
self.fail_next_get = False
|
||||
raise FailingQueueException, "You Lose"
|
||||
raise FailingQueueException("You Lose")
|
||||
return Queue.Queue._get(self)
|
||||
|
||||
def FailingQueueTest(q):
|
||||
if not q.empty():
|
||||
raise RuntimeError, "Call this function with an empty queue"
|
||||
raise RuntimeError("Call this function with an empty queue")
|
||||
for i in range(QUEUE_SIZE-1):
|
||||
q.put(i)
|
||||
# Test a failing non-blocking put.
|
||||
|
@ -178,7 +178,7 @@ def FailingQueueTest(q):
|
|||
|
||||
def SimpleQueueTest(q):
|
||||
if not q.empty():
|
||||
raise RuntimeError, "Call this function with an empty queue"
|
||||
raise RuntimeError("Call this function with an empty queue")
|
||||
# I guess we better check things actually queue correctly a little :)
|
||||
q.put(111)
|
||||
q.put(222)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue