summaryrefslogtreecommitdiff
path: root/src/pyinterp.cc
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2014-02-01 16:15:51 +0100
committerJohann Klähn <kljohann@gmail.com>2014-02-01 19:29:25 +0100
commite362a481ec3886730386549d16e3ce8e74652c28 (patch)
tree7e2de2b900b2a67eeaaa30778311eb4d5cdaca2d /src/pyinterp.cc
parent0dc2b97813009c0e5f9953209a5e2fd073989dfc (diff)
downloadfork-ledger-e362a481ec3886730386549d16e3ce8e74652c28.tar.gz
fork-ledger-e362a481ec3886730386549d16e3ce8e74652c28.tar.bz2
fork-ledger-e362a481ec3886730386549d16e3ce8e74652c28.zip
Create default scope from python session only if needed
Fixes test failures introduced with the commit "Create default scope to read journal" a9078767b8224a223f8942a1cb80d4544024387b
Diffstat (limited to 'src/pyinterp.cc')
-rw-r--r--src/pyinterp.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pyinterp.cc b/src/pyinterp.cc
index 12690854..9f2b2b20 100644
--- a/src/pyinterp.cc
+++ b/src/pyinterp.cc
@@ -78,9 +78,11 @@ void initialize_for_python()
export_session();
export_journal();
- python_session.reset(new ledger::python_interpreter_t);
- shared_ptr<session_t> session_ptr = python_session;
- scope_t::default_scope = new report_t(*session_ptr);
+ if (! scope_t::default_scope) {
+ python_session.reset(new ledger::python_interpreter_t);
+ shared_ptr<session_t> session_ptr = python_session;
+ scope_t::default_scope = new report_t(*session_ptr);
+ }
}
struct python_run