I assume you are waiting for this to have an effect?  In that case, the way to wait for replies would be:

```python
# 2 because you send two shell requests
for i in range(2):
    try:
        reply = client.get_shell_msg(timeout=5)
    except Queue.Empty:
        # timeout, indicates that the kernel isn't actually running (or responsive).
        # you may want to handle this somehow
        break
```