[Python-checkins] bpo-31792: Restore os.environ in test_buffer when import numpy. (#4007)

Serhiy Storchaka webhook-mailer at python.org
Mon Oct 16 03:38:17 EDT 2017


https://github.com/python/cpython/commit/676db4bbf2e7c18dc7c35add17dd3bbdc2d3eeb3
commit: 676db4bbf2e7c18dc7c35add17dd3bbdc2d3eeb3
branch: master
author: Serhiy Storchaka <storchaka at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017年10月16日T10:38:14+03:00
summary:
bpo-31792: Restore os.environ in test_buffer when import numpy. (#4007)
files:
M Lib/test/test_buffer.py
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index b83f2f107c1..f302da415d3 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -17,7 +17,7 @@
 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 @@
 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


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /