EXEC_FLAG_PRINT_EOF prints 2 EOF chars: 1 after normal output, 1 after exception output

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

EXEC_FLAG_PRINT_EOF prints 2 EOF chars: 1 after normal output, 1 after exception output

Post by jickster » Thu Jan 11, 2018 9:52 pm

Code: Select all

// EXEC_FLAG_PRINT_EOF prints 2 EOF chars: 1 after normal output, 1 after exception output
What is the use of this?
Also, comment is incorrect: during normal output, it outputs two EOF chars.

https://github.com/micropython/micropyt ... c#L62-L151

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: EXEC_FLAG_PRINT_EOF prints 2 EOF chars: 1 after normal output, 1 after exception output

Post by dhylands » Thu Jan 11, 2018 10:28 pm

This has to do with the raw REPL which is where code is uploaded to the board, but the uploading of the characters is not echoed back.

This is used by pyboard.py, which is used as part of the test suite. Snippets of code are uploaded and they either execute correctly, or cause an exception to be raised. In either case we want to know that the code is "done". Otherwise it would just hang there waiting forever without knowing if more output was coming or not.

I'd agree that the comment is slightly misleading.

Post Reply