amoffat/Inspect-Shell — Issue #3: some kind of stdout locking
Author: amoffat
Created: 2011-12-10 05:42:34+00:00
State: open

If a command from the shell takes too long (for example, a time.sleep), output from the program inspect shell is watching will get added into the result returned to the shell. Here's an example:

```python
import inspect_shell
import time

herpderp = 1
while True:
time.sleep(1)
herpderp+=1
print herpderp
```

$ python inspect_shell.py
rs:1234> time.sleep(10)
7
8
9
10
11
12
13
14
15
16

This is because the evaluating part of the shell (the part that runs in the program), captures all stdout. If a command causes the evaluating thread to yield, stdout is still being captured when the main program is being run.