M
Magnus.Moraberg
Hi,
I found the following code on the net -
http://mail-archives.apache.org/[email protected]>
def count(self):
- db = sqlite.connect(self.filename,
isolation_level=ISOLATION_LEVEL)
- try:
- try:
- cur = db.cursor()
- cur.execute("select count(*) from sessions")
- return cur.fetchone()[0]
- finally:
- cur.close()
- finally:
- db.close()
I don't understand though why the second try is not after the line cur
= db.cursor(). Can anyone explain for me why?
/Barry.
I found the following code on the net -
http://mail-archives.apache.org/[email protected]>
def count(self):
- db = sqlite.connect(self.filename,
isolation_level=ISOLATION_LEVEL)
- try:
- try:
- cur = db.cursor()
- cur.execute("select count(*) from sessions")
- return cur.fetchone()[0]
- finally:
- cur.close()
- finally:
- db.close()
I don't understand though why the second try is not after the line cur
= db.cursor(). Can anyone explain for me why?
/Barry.