Fix tempfile reset code & test on newer Python
authorIustin Pop <iustin@google.com>
Tue, 6 Mar 2012 19:38:18 +0000 (21:38 +0200)
committerIustin Pop <iustin@google.com>
Wed, 7 Mar 2012 20:59:01 +0000 (22:59 +0200)
commit035b33e20bc54c0c26942a0864c0384190881484
treeff255c9c0b41ef7abcae36a0395cf44a876dbb00
parent7bfb336771c1b7be4572940a855dccc26e08d8e2
Fix tempfile reset code & test on newer Python

Python 2.7.3 (rc status) and 3.2.3/3.3 (rc, respectively alpha status)
have fixed http://bugs.python.org/issue12856 which we worked around
ourselves.

This means two things:

- we don't need to manually reset the module
- we can't test for the no-reset case

Unfortunately current Debian Sid has the 2.7.3 RC but still labeled as
2.7.2+ ☹, so we have to manually do an extra check (in the unit test
only); I expect Debian will update to official 2.7.3 as soon as it's
released, and then we can remove this override.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
lib/utils/wrapper.py
test/tempfile_fork_unittest.py