[Python-checkins] cpython (2.7): Show how to close a connection

raymond.hettinger python-checkins at python.org
Wed Sep 26 01:57:59 CEST 2012


http://hg.python.org/cpython/rev/1b8e66ea3f89
changeset: 79190:1b8e66ea3f89
branch: 2.7
parent: 79182:d903d4981e33
user: Raymond Hettinger <python at rcn.com>
date: Tue Sep 25 19:57:50 2012 -0400
summary:
 Show how to close a connection
files:
 Doc/library/sqlite3.rst | 5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -42,8 +42,9 @@
 # Save (commit) the changes
 conn.commit()
 
- # We can also close the cursor if we are done with it
- c.close()
+ # We can also close the connection if we are done with it.
+ # Just be sure any changes have been committed or they will be lost.
+ conn.close()
 
 The data you've saved is persistent and is available in subsequent sessions::
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /