Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0694958

Browse files
miss-islingtonserhiy-storchaka
authored andcommitted
[3.6] bpo-31792: Restore os.environ in test_buffer when import numpy. (GH-4007) (#4009)
(cherry picked from commit 676db4b)
1 parent cfc6047 commit 0694958

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/test/test_buffer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from itertools import permutations, product
1818
from random import randrange, sample, choice
1919
import warnings
20-
import sys, array, io
20+
import sys, array, io, os
2121
from decimal import Decimal
2222
from fractions import Fraction
2323

@@ -37,7 +37,8 @@
3737
ctypes = None
3838

3939
try:
40-
with warnings.catch_warnings():
40+
with support.EnvironmentVarGuard() as os.environ, \
41+
warnings.catch_warnings():
4142
from numpy import ndarray as numpy_array
4243
except ImportError:
4344
numpy_array = None

0 commit comments

Comments
 (0)