# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
-import os, re, resource, sys
-import subprocess, fcntl
+import os, re, sys
+if os.name == "posix":
+ import resource, fcntl
+import subprocess
from shutil import copyfile
from select import select
from time import time, localtime
self.job.log("%s: starting process \"%s\"" % (self.info, self.cmdline))
self.p = subprocess.Popen(self.cmdline, shell=True, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE,
stderr=(subprocess.STDOUT if self.logstderr else None))
- fl = fcntl.fcntl(self.p.stdout, fcntl.F_GETFL)
- fcntl.fcntl(self.p.stdout, fcntl.F_SETFL, fl | os.O_NONBLOCK)
+ if os.name == "posix":
+ fl = fcntl.fcntl(self.p.stdout, fcntl.F_GETFL)
+ fcntl.fcntl(self.p.stdout, fcntl.F_SETFL, fl | os.O_NONBLOCK)
self.job.tasks_pending.remove(self)
self.job.tasks_running.append(self)
self.running = True
self.start_clock_time = time()
- ru = resource.getrusage(resource.RUSAGE_CHILDREN)
- self.start_process_time = ru.ru_utime + ru.ru_stime
+ if os.name == "posix":
+ ru = resource.getrusage(resource.RUSAGE_CHILDREN)
+ self.start_process_time = ru.ru_utime + ru.ru_stime
self.summary = list()
total_clock_time = int(time() - self.start_clock_time)
- ru = resource.getrusage(resource.RUSAGE_CHILDREN)
- total_process_time = int((ru.ru_utime + ru.ru_stime) - self.start_process_time)
- self.total_time = total_process_time
+ if os.name == "posix":
+ ru = resource.getrusage(resource.RUSAGE_CHILDREN)
+ total_process_time = int((ru.ru_utime + ru.ru_stime) - self.start_process_time)
+ self.total_time = total_process_time
+ else:
+ total_process_time = 0
self.summary = [
"Elapsed clock time [H:MM:SS (secs)]: %d:%02d:%02d (%d)" %