Combine consecutive with statements

Python 2.7 allows to combine several 'with' instructions.