This reverts commit a772f0bb92.
The main problem was related to how we handled `dbgs()` from the hosted
compiler. Using explicit `subprocess.communicate`, and not relying on
dbgs() being flushed until the end appears to address the problem.
Also some fixes due to some bots running older pythons, so we can't have
nice things like `int | float` and such.
22 lines
418 B
Python
22 lines
418 B
Python
import interactive_host
|
|
import sys
|
|
|
|
|
|
def main(args):
|
|
|
|
class Advisor:
|
|
to_return = False
|
|
|
|
def advice(self, _):
|
|
# The adice will be a sequence of yes/no/yes/no/...
|
|
# see ../interactive-mode.ll
|
|
self.to_return = not self.to_return
|
|
return int(self.to_return)
|
|
|
|
a = Advisor()
|
|
interactive_host.run_interactive(args[0], a.advice, args[1:])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main(sys.argv[1:])
|