there's nothing stringIO specific about this function any more. it can become:

```
def context_wrapper(instance):
    @contextlib.contextmanager
    def manager():
          yield instance
    return manger
```