~ubuntu-branches/ubuntu/saucy/software-properties/saucy-proposed

« back to all changes in this revision

Viewing changes to softwareproperties/MirrorTest.py

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre, Colin Watson, Mathieu Trudel-Lapierre
  • Date: 2012-07-05 11:50:44 UTC
  • Revision ID: package-import@ubuntu.com-20120705115044-k8hf3i7hrtp3e44n
Tags: 0.86
[ Colin Watson ]
* Open /dev/urandom in binary mode.
* Start producing python-software-properties again, until such time as it
  has no reverse-dependencies.

[ Mathieu Trudel-Lapierre ]
* Fix things so that reverse-depends can still work with Python 2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
2
 
 
3
from __future__ import print_function
 
4
 
3
5
import threading
4
 
import queue
 
6
try:
 
7
    from queue import Empty, Queue
 
8
except ImportError:
 
9
    from Queue import Empty, Queue
5
10
import time
6
11
import re
7
12
import subprocess
45
50
                        if not line:
46
51
                            break
47
52
                        result = re.findall(self.match_result, line)
48
 
                except queue.Empty:
 
53
                except Empty:
49
54
                    return
50
55
                except:
51
56
                    self.parent.report_action("Skipping %s" % host)
119
124
           the download test is only a part of a whole series of tests."""
120
125
        if mirrors == None:
121
126
            mirrors = self.mirrors
122
 
        jobs = queue.Queue()
 
127
        jobs = Queue()
123
128
        for m in mirrors:
124
129
            jobs.put(m)
125
130
        results = []