e3673091d04ef00cea5d7d8bcac69c0dee40e585,calamari_ocr/utils/multiprocessing.py,,run,#Any#Any#,22
Before Change
if line is None or len(line) == 0:
time.sleep(0.1)
else:
yield line
if process.returncode != 0:
raise Exception("Error: Process finished with code {}".format(process.returncode))
After Change
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False, env=env,
close_fds=ON_POSIX, text=True, bufsize=1)
// Make nonblocking output
stdout_queue = Queue()
stdout_reader = Thread(target=enqueue_output, args=(process.stdout, stdout_queue), daemon=True)
stdout_reader.start()
stderr_queue = Queue()
stderr_reader = Thread(target=enqueue_output, args=(process.stderr, stderr_queue), daemon=True)
stderr_reader.start()
while True:
try:
out = stdout_queue.get_nowait()
except Empty:
out = None
try:
err = stderr_queue.get_nowait()
except Empty:
err = None
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: Calamari-OCR/calamari
Commit Name: e3673091d04ef00cea5d7d8bcac69c0dee40e585
Time: 2021-01-19
Author: wick.chr@gmail.com
File Name: calamari_ocr/utils/multiprocessing.py
Class Name:
Method Name: run
Project Name: coala/coala-bears
Commit Name: b68ab2b4e4cbea341e9b2d16cc58cd24a5859aa5
Time: 2016-07-27
Author: toabhayraizada@gmail.com
File Name: bears/general/AnnotationBear.py
Class Name: AnnotationBear
Method Name: run
Project Name: acoular/acoular
Commit Name: 97a543976472f88b7922cc8f8ef3d7c0b6cd3dee
Time: 2012-02-06
Author: sarradj@tu-cottbus.de
File Name: beamfpy/sources.py
Class Name: PointSource
Method Name: result