File tree 2 files changed +4
-2
lines changed
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):
157
157
return self .conn .cursor ()
158
158
159
159
def _load_iris_data (self ):
160
+ import io
160
161
iris_csv_file = os .path .join (tm .get_data_path (), 'iris.csv' )
161
162
162
163
self .drop_table ('iris' )
163
164
self ._get_exec ().execute (SQL_STRINGS ['create_iris' ][self .flavor ])
164
165
165
- with open (iris_csv_file , 'rU' ) as iris_csv :
166
+ with io . open (iris_csv_file , mode = 'r' , newline = None ) as iris_csv :
166
167
r = csv .reader (iris_csv )
167
168
next (r ) # skip header row
168
169
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):
4249
4249
assert_series_equal (checkseries , series )
4250
4250
4251
4251
def test_to_csv (self ):
4252
+ import io
4252
4253
4253
4254
with ensure_clean () as path :
4254
4255
self .ts .to_csv (path )
4255
4256
4256
- lines = open (path , 'U' ).readlines ()
4257
+ lines = io . open (path , newline = None ).readlines ()
4257
4258
assert (lines [1 ] != '\n ' )
4258
4259
4259
4260
self .ts .to_csv (path , index = False )
You can’t perform that action at this time.
0 commit comments