Author: Brian Kearns <[email protected]>
Branch:
Changeset: r63381:fea5257cc5ba
Date: 2013-04-15 13:54 -0400
http://bitbucket.org/pypy/pypy/changeset/fea5257cc5ba/
Log: clean up this logic to match __next__
diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -998,17 +998,18 @@
# Actually execute the SQL statement
ret = _lib.sqlite3_step(self.__statement._statement)
- if ret not in (_lib.SQLITE_DONE, _lib.SQLITE_ROW):
- self.__statement._reset()
- raise self.__connection._get_exception(ret)
if ret == _lib.SQLITE_ROW:
if multiple:
raise ProgrammingError("executemany() can only execute
DML statements.")
self.__build_row_cast_map()
self.__next_row = self.__fetch_one_row()
- elif ret == _lib.SQLITE_DONE and not multiple:
+ elif ret == _lib.SQLITE_DONE:
+ if not multiple:
+ self.__statement._reset()
+ else:
self.__statement._reset()
+ raise self.__connection._get_exception(ret)
if self.__statement._type in ("UPDATE", "DELETE", "INSERT",
"REPLACE"):
if self.__rowcount == -1:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit