From 6e12117b04937b76bbc3ee96f7d3eb66247b645f Mon Sep 17 00:00:00 2001 From: Ian Dotson Date: Mon, 13 Apr 2015 17:01:00 -0400 Subject: [PATCH] Import queue from six.moves for python3 compatibility. --- v2/ansible/executor/process/result.py | 6 +++--- v2/ansible/executor/process/worker.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/v2/ansible/executor/process/result.py b/v2/ansible/executor/process/result.py index 761db21fe69..f0416db852d 100644 --- a/v2/ansible/executor/process/result.py +++ b/v2/ansible/executor/process/result.py @@ -19,7 +19,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -import Queue +from six.moves import queue import multiprocessing import os import signal @@ -77,7 +77,7 @@ class ResultProcess(multiprocessing.Process): result = rslt_q.get(block=False) debug("got a result from worker %d: %s" % (self._cur_worker, result)) break - except Queue.Empty: + except queue.Empty: pass if self._cur_worker == starting_point: @@ -164,7 +164,7 @@ class ResultProcess(multiprocessing.Process): if result._task.register: self._send_result(('set_host_var', result._host, result._task.register, result._result)) - except Queue.Empty: + except queue.Empty: pass except (KeyboardInterrupt, IOError, EOFError): break diff --git a/v2/ansible/executor/process/worker.py b/v2/ansible/executor/process/worker.py index bf5ee8c93f0..8e624fe401e 100644 --- a/v2/ansible/executor/process/worker.py +++ b/v2/ansible/executor/process/worker.py @@ -19,7 +19,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -import Queue +from six.moves import queue import multiprocessing import os import signal @@ -130,7 +130,7 @@ class WorkerProcess(multiprocessing.Process): else: time.sleep(0.1) - except Queue.Empty: + except queue.Empty: pass except (IOError, EOFError, KeyboardInterrupt): break