diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2017-10-16 08:21:30 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-10-16 08:21:30 (GMT) |
commit | 06949585d292d1a9dbf2d0d0fa8fc8fe1dee3ccf (patch) | |
tree | 1ecf265ab88f236c7de99da6bfcdb00fc4313ce3 | |
parent | cfc604722ff5ad64de96ddeb944661f1e94d8cd0 (diff) | |
download | cpython-06949585d292d1a9dbf2d0d0fa8fc8fe1dee3ccf.zip cpython-06949585d292d1a9dbf2d0d0fa8fc8fe1dee3ccf.tar.gz cpython-06949585d292d1a9dbf2d0d0fa8fc8fe1dee3ccf.tar.bz2 |
[3.6] bpo-31792: Restore os.environ in test_buffer when import numpy. (GH-4007) (#4009)
(cherry picked from commit 676db4bbf2e7c18dc7c35add17dd3bbdc2d3eeb3)
-rw-r--r-- | Lib/test/test_buffer.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py index b83f2f1..f302da4 100644 --- a/Lib/test/test_buffer.py +++ b/Lib/test/test_buffer.py @@ -17,7 +17,7 @@ from test import support from itertools import permutations, product from random import randrange, sample, choice import warnings -import sys, array, io +import sys, array, io, os from decimal import Decimal from fractions import Fraction @@ -37,7 +37,8 @@ except ImportError: ctypes = None try: - with warnings.catch_warnings(): + with support.EnvironmentVarGuard() as os.environ, \ + warnings.catch_warnings(): from numpy import ndarray as numpy_array except ImportError: numpy_array = None |