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 @@ -4235,11 +4235,12 @@ def test_from_csv(self):
4235
4235
assert_series_equal (checkseries , series )
4236
4236
4237
4237
def test_to_csv (self ):
4238
+ import io
4238
4239
4239
4240
with ensure_clean () as path :
4240
4241
self .ts .to_csv (path )
4241
4242
4242
- lines = open (path , 'U' ).readlines ()
4243
+ lines = io . open (path , newline = None ).readlines ()
4243
4244
assert (lines [1 ] != '\n ' )
4244
4245
4245
4246
self .ts .to_csv (path , index = False )
You can’t perform that action at this time.
0 commit comments