77import test .support
88import unittest
99from ctypes import CDLL , c_int
10- from test .support .os_helper import create_empty_file
10+ from test .support .os_helper import create_empty_file , temp_dir
1111
1212
1313FOO_C = r"""
@@ -144,7 +144,7 @@ def make_empty_lib(self, outdir, so_libname):
144144
145145 @configure_locales
146146 def test_localized_error_from_dll (self ):
147- with tempfile . TemporaryDirectory () as outdir :
147+ with temp_dir () as outdir :
148148 dstname = self .make_empty_lib (outdir , 'test_from_dll.so' )
149149 dll = CDLL (dstname )
150150 with self .assertRaises (AttributeError ) as cm :
@@ -155,7 +155,7 @@ def test_localized_error_from_dll(self):
155155
156156 @configure_locales
157157 def test_localized_error_in_dll (self ):
158- with tempfile . TemporaryDirectory () as outdir :
158+ with temp_dir () as outdir :
159159 dstname = self .make_empty_lib (outdir , 'test_in_dll.so' )
160160 dll = CDLL (dstname )
161161 with self .assertRaises (ValueError ) as cm :
@@ -183,7 +183,7 @@ def test_localized_error_dlopen(self):
183183 'test requires _ctypes.dlsym()' )
184184 @configure_locales
185185 def test_localized_error_dlsym (self ):
186- with tempfile . TemporaryDirectory () as outdir :
186+ with temp_dir () as outdir :
187187 dstname = self .make_empty_lib (outdir , 'test_dlsym.so' )
188188 dll = _ctypes .dlopen (dstname )
189189 with self .assertRaises (OSError ) as cm :
0 commit comments