Skip to content

Commit 4e150c7

Browse files
committed
FIX old exception syntax
DOC add to release notes
1 parent 89ad14d commit 4e150c7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

doc/source/release.rst

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ Bug Fixes
152152
- Possible segfault when chained indexing with an object array under numpy 1.7.1 (:issue:`6026`, :issue:`6056`)
153153
- Bug in setting using fancy indexing a single element with a non-scalar (e.g. a list),
154154
(:issue:`6043`)
155+
- ``to_sql`` did not respect ``if_exists`` (:issue:`4110` :issue:`4304`)
155156
- Regression in ``.get(None)`` indexing from 0.12 (:issue:`5652`)
156157
- Subtle ``iloc`` indexing bug, surfaced in (:issue:`6059`)
157158
- Bug with insert of strings into DatetimeIndex (:issue:`5818`)

pandas/io/sql.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def write_frame(frame, name, con, flavor='sqlite', if_exists='fail', **kwargs):
202202
if_exists = 'fail'
203203

204204
if if_exists not in ('fail', 'replace', 'append'):
205-
raise ValueError, "'%s' is not valid for if_exists" % if_exists
205+
raise ValueError("'%s' is not valid for if_exists" % if_exists)
206206

207207
exists = table_exists(name, con, flavor)
208208
if if_exists == 'fail' and exists:
@@ -212,7 +212,7 @@ def write_frame(frame, name, con, flavor='sqlite', if_exists='fail', **kwargs):
212212
create = None
213213
if exists:
214214
if if_exists == 'fail':
215-
raise ValueError, "Table '%s' already exists." % name
215+
raise ValueError("Table '%s' already exists." % name)
216216
elif if_exists == 'replace':
217217
cur = con.cursor()
218218
cur.execute("DROP TABLE %s;" % name)

0 commit comments

Comments
 (0)