The hack to sync r2 output isn't needed on linux
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
def eprint(*args, **kwargs):
|
def eprint(*args, **kwargs):
|
||||||
@@ -25,11 +26,10 @@ def sync_r2_output(r2):
|
|||||||
|
|
||||||
Read stuff from the process pipe until it stops being stupid.
|
Read stuff from the process pipe until it stops being stupid.
|
||||||
"""
|
"""
|
||||||
for i in range(10):
|
time.sleep(1)
|
||||||
p = r2.process.stdout.read(1)
|
os.set_blocking(r2.process.stdout.fileno(), False)
|
||||||
if len(p) > 0:
|
p = r2.process.stdout.read(1)
|
||||||
break
|
os.set_blocking(r2.process.stdout.fileno(), True)
|
||||||
time.sleep(1)
|
|
||||||
output = r2.cmd(f"?vi 123").strip()
|
output = r2.cmd(f"?vi 123").strip()
|
||||||
if output != "123":
|
if output != "123":
|
||||||
raise Exception("R2 state never got synced")
|
raise Exception("R2 state never got synced")
|
||||||
|
|||||||
Reference in New Issue
Block a user