@@ -307,6 +307,8 @@ def test_writestr_compression(self):
307
307
zipfp .writestr ("b.txt" , "hello world" , compress_type = self .compression )
308
308
info = zipfp .getinfo ('b.txt' )
309
309
self .assertEqual (info .compress_type , self .compression )
310
+ # GraalPy change
311
+ zipfp .close ()
310
312
311
313
def test_writestr_compresslevel (self ):
312
314
zipfp = zipfile .ZipFile (TESTFN2 , "w" , compresslevel = 1 )
@@ -323,6 +325,8 @@ def test_writestr_compresslevel(self):
323
325
b_info = zipfp .getinfo ('b.txt' )
324
326
self .assertEqual (b_info .compress_type , self .compression )
325
327
self .assertEqual (b_info ._compresslevel , 2 )
328
+ # GraalPy change
329
+ zipfp .close ()
326
330
327
331
def test_read_return_size (self ):
328
332
# Issue #9837: ZipExtFile.read() shouldn't return more bytes
@@ -2075,13 +2079,17 @@ def test_empty_zipfile(self):
2075
2079
zipf .close ()
2076
2080
try :
2077
2081
zipf = zipfile .ZipFile (TESTFN , mode = "r" )
2082
+ # GraalPy change
2083
+ zipf .close ()
2078
2084
except zipfile .BadZipFile :
2079
2085
self .fail ("Unable to create empty ZIP file in 'w' mode" )
2080
2086
2081
2087
zipf = zipfile .ZipFile (TESTFN , mode = "a" )
2082
2088
zipf .close ()
2083
2089
try :
2084
2090
zipf = zipfile .ZipFile (TESTFN , mode = "r" )
2091
+ # GraalPy change
2092
+ zipf .close ()
2085
2093
except :
2086
2094
self .fail ("Unable to create empty ZIP file in 'a' mode" )
2087
2095
0 commit comments