Skip to content

Commit

Permalink
test/apps: More python3 fixing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfonseca committed Jul 18, 2018
1 parent 9780ec8 commit 796539d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/apps/test.py
Expand Up @@ -37,6 +37,10 @@
import threading
import multiprocessing.dummy as multiprocessing

from multiprocessing import cpu_count


assert sys.version_info.major >= 3


stdoutLock = threading.Lock()
Expand Down Expand Up @@ -132,8 +136,11 @@ def test(args):
stdout = stdout.read()
stderr = stderr.read()

stdout = stdout.replace('\r\n', '\n')
stderr = stderr.replace('\r\n', '\n')
stdout = stdout.replace(b'\r\n', b'\n')
stderr = stderr.replace(b'\r\n', b'\n')

stdout = stdout.decode()
stderr = stderr.decode()

if options.verbose:
with stdoutLock:
Expand Down Expand Up @@ -243,7 +250,7 @@ def main():

failedTests = []

numJobs = multiprocessing.cpu_count()
numJobs = cpu_count()
pool = multiprocessing.Pool(numJobs)

testSrcFiles = os.listdir(testsSrcDir)
Expand Down

0 comments on commit 796539d

Please sign in to comment.