Added a workaround for a pypy bug in context managers