summaryrefslogtreecommitdiff
path: root/src/pyinterp.cc
diff options
context:
space:
mode:
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