On Wed, 2015-08-19 at 16:51 -0700, Sylvain Bauza wrote: > I was writing some tests so I added a contextlib.nested to a checked > TestCase [1]. Unfortunately, contextlib.nested is no longer available in > Python3 and there is no clear solution on how to provide a compatible > import for both python2 and python3: > - either providing a python3 compatible behaviour by using > contextlib.ExitStack but that class is not available in Python 2 > - or provide contextlib2 for python2 (and thus adding it to the > requirements)
Actually, there should no longer be a need to use contextlib.nested. We've explicitly dropped Python 2.6 compatibility, which means we're expecting compatibility with Python 2.7+ only, and as of Python 2.7, the 'with' statement supports accepting multiple 'as' clauses. The contextlib.nested tool was really only necessary to work around that functionality being missing in Python 2.6, and has been deprecated as of Python 2.7 because it's no longer necessary. -- Kevin L. Mitchell <kevin.mitch...@rackspace.com> Rackspace __________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev