File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -157,12 +157,13 @@ def _get_exec(self):
157157 return self .conn .cursor ()
158158
159159 def _load_iris_data (self ):
160+ import io
160161 iris_csv_file = os .path .join (tm .get_data_path (), 'iris.csv' )
161162
162163 self .drop_table ('iris' )
163164 self ._get_exec ().execute (SQL_STRINGS ['create_iris' ][self .flavor ])
164165
165- with open (iris_csv_file , 'rU' ) as iris_csv :
166+ with io . open (iris_csv_file , mode = 'r' , newline = None ) as iris_csv :
166167 r = csv .reader (iris_csv )
167168 next (r ) # skip header row
168169 ins = SQL_STRINGS ['insert_iris' ][self .flavor ]
Original file line number Diff line number Diff line change @@ -4249,11 +4249,12 @@ def test_from_csv(self):
42494249 assert_series_equal (checkseries , series )
42504250
42514251 def test_to_csv (self ):
4252+ import io
42524253
42534254 with ensure_clean () as path :
42544255 self .ts .to_csv (path )
42554256
4256- lines = open (path , 'U' ).readlines ()
4257+ lines = io . open (path , newline = None ).readlines ()
42574258 assert (lines [1 ] != '\n ' )
42584259
42594260 self .ts .to_csv (path , index = False )
You can’t perform that action at this time.
0 commit comments