tbielawa / bitmath

Python module for representing file sizes with different prefix notations
http://bitmath.readthedocs.org/en/latest/
MIT License
93 stars 25 forks source link

Restore Python 2.6 compatibility in tests #56

Closed encukou closed 8 years ago

encukou commented 8 years ago

contextlib.nested was removed in Python 3.0, because of problems with exceptions raised in initialization of its individual context managers. Its replacement, ExitStack, is not available in Python 2.

Emulate the old "nested" in terms of ExitStack if it's not available.

Partially reverts commit 973202b3b55fa9e8a089c1feb4db65ccc24fac35

Tested on Python 2.6, 2.7, and (excluding progressbar/argparse tests) 3.4.

tbielawa commented 8 years ago

That's wonderful. I love it. Thanks a whole bunch!