mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug #675201 - slight bugfix to prior enchancement post for example
scripts Patch by Jamie Campbell git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22231 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
867db62422
commit
4b0b7c51f4
@ -268,7 +268,7 @@ def main():
|
||||
# no save needed, we're just reading..
|
||||
gnucash_session.end()
|
||||
except:
|
||||
if not gnucash_session == None:
|
||||
if "gnucash_session" in locals():
|
||||
gnucash_session.end()
|
||||
|
||||
raise
|
||||
|
@ -343,10 +343,10 @@ def main():
|
||||
new_book_session.end()
|
||||
original_book_session.end()
|
||||
except:
|
||||
if not original_book_session == None:
|
||||
if "original_book_session" in locals():
|
||||
original_book_session.end()
|
||||
|
||||
if not new_book_session == None:
|
||||
if "new_book_session" in locals():
|
||||
new_book_session.end()
|
||||
|
||||
raise
|
||||
|
@ -69,9 +69,8 @@ if len(argv) < 2:
|
||||
exit()
|
||||
|
||||
|
||||
s = Session(argv[1], is_new=True)
|
||||
|
||||
try:
|
||||
s = Session(argv[1], is_new=True)
|
||||
|
||||
book = s.book
|
||||
root = book.get_root_account()
|
||||
@ -185,6 +184,6 @@ try:
|
||||
|
||||
s.end()
|
||||
except:
|
||||
if not s == None:
|
||||
if "s" in locals():
|
||||
s.end()
|
||||
raise
|
||||
|
@ -48,9 +48,10 @@ if len(argv) < 2:
|
||||
print "gnucash-env python test_imbalance_transaction.py '/home/username/test.gnucash'"
|
||||
exit()
|
||||
|
||||
session = Session(argv[1])
|
||||
|
||||
try:
|
||||
session = Session(argv[1])
|
||||
|
||||
book = session.book
|
||||
|
||||
root = book.get_root_account()
|
||||
@ -98,6 +99,6 @@ try:
|
||||
session.end()
|
||||
session.destroy()
|
||||
except:
|
||||
if not session == None:
|
||||
if "session" in locals():
|
||||
session.end()
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user