File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,8 @@ def test_from_buffer(self):
4444 df0 = self .data [j ]
4545 for k in self .test_ix [j ]:
4646 fname = os .path .join (self .dirpath , "test%d.sas7bdat" % k )
47- byts = open (fname , 'rb' ).read ()
47+ with open (fname , 'rb' ) as f :
48+ byts = f .read ()
4849 buf = io .BytesIO (byts )
4950 df = pd .read_sas (buf , format = "sas7bdat" , encoding = 'utf-8' )
5051 tm .assert_frame_equal (df , df0 , check_exact = False )
@@ -54,7 +55,8 @@ def test_from_iterator(self):
5455 df0 = self .data [j ]
5556 for k in self .test_ix [j ]:
5657 fname = os .path .join (self .dirpath , "test%d.sas7bdat" % k )
57- byts = open (fname , 'rb' ).read ()
58+ with open (fname , 'rb' ) as f :
59+ byts = f .read ()
5860 buf = io .BytesIO (byts )
5961 rdr = pd .read_sas (buf , format = "sas7bdat" ,
6062 iterator = True , encoding = 'utf-8' )
You can’t perform that action at this time.
0 commit comments