3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-06 14:24:08 +00:00

Merge pull request #67 from mmicko/mmicko/windows_fix

Fix sby execution on Windows
This commit is contained in:
Claire Wolf 2020-01-21 17:15:27 +01:00 committed by GitHub
commit c5dfa320df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,13 +16,13 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# #
import os, re, sys import os, re, sys, signal
if os.name == "posix": if os.name == "posix":
import resource, fcntl, signal import resource, fcntl
import subprocess import subprocess
from shutil import copyfile, rmtree from shutil import copyfile, rmtree
from select import select from select import select
from time import time, localtime from time import time, localtime, sleep
all_tasks_running = [] all_tasks_running = []
@ -242,10 +242,13 @@ class SbyJob:
if task.running: if task.running:
fds.append(task.p.stdout) fds.append(task.p.stdout)
try: if os.name == "posix":
select(fds, [], [], 1.0) == ([], [], []) try:
except InterruptedError: select(fds, [], [], 1.0) == ([], [], [])
pass except InterruptedError:
pass
else:
sleep(0.1)
for task in self.tasks_running: for task in self.tasks_running:
task.poll() task.poll()