Bug 638219 - Clean up imports and unused variables. r=terrence

This commit is contained in:
Dirkjan Ochtman 2013-01-22 21:48:05 +01:00
Родитель bde11ecb19
Коммит d3cb48b1a1
4 изменённых файлов: 5 добавлений и 12 удалений

Просмотреть файл

@ -6,14 +6,14 @@
# jit_test.py -- Python harness for JavaScript trace tests.
import datetime, os, re, sys, tempfile, traceback, time, shlex
import os, sys, tempfile, traceback, time, shlex
import subprocess
from subprocess import *
from threading import Thread
import signal
try:
from multiprocessing import Process, Queue, Manager, cpu_count
from multiprocessing import Process, Manager, cpu_count
HAVE_MULTIPROCESSING = True
except ImportError:
HAVE_MULTIPROCESSING = False
@ -182,7 +182,6 @@ def run_timeout_cmd(cmdline, options, timeout=60.0):
# then we are running as a child process for parallel
# execution and we must ensure to kill our child
# when we are signaled to exit.
import signal
sigint_handler = signal.getsignal(signal.SIGINT)
sigterm_handler = signal.getsignal(signal.SIGTERM)
if (sigint_handler == signal.SIG_IGN):
@ -206,7 +205,6 @@ def run_timeout_cmd(cmdline, options, timeout=60.0):
if l[0] is not None:
try:
# In Python 3, we could just do l[0].kill().
import signal
if sys.platform != 'win32':
os.kill(l[0].pid, signal.SIGKILL)
else:

Просмотреть файл

@ -2,7 +2,7 @@
# waitpid to dispatch tasks. This avoids several deadlocks that are possible
# with fork/exec + threads + Python.
import errno, os, sys, select
import errno, os, select
from datetime import datetime, timedelta
from results import TestOutput

Просмотреть файл

@ -1,6 +1,5 @@
# Multiprocess activities with a push-driven divide-process-collect model.
import os, sys, time
from threading import Thread, Lock
from Queue import Queue, Empty
from datetime import datetime
@ -26,10 +25,6 @@ class Source:
w.start()
ans = self.join_workers()
if self.verbose: print '[P] Finished.'
t1 = datetime.now()
dt = t1-t0
return ans
def join_workers(self):

Просмотреть файл

@ -3,7 +3,7 @@
# This contains classes that represent an individual test, including
# metadata, and know how to run the tests and determine failures.
import datetime, os, re, sys, time
import datetime, os, sys, time
from subprocess import *
from threading import *
@ -59,7 +59,7 @@ def run_cmd(cmd, timeout=60.0):
os.kill(l[0].pid, signal.SIGKILL)
time.sleep(.1)
timed_out = True
except OSError, e:
except OSError:
# Expecting a "No such process" error
pass
th.join()