summaryrefslogtreecommitdiff
path: root/src/pyinterp.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2011-02-28 16:24:15 -0500
committerJohn Wiegley <johnw@newartisans.com>2011-02-28 16:24:15 -0500
commit8388baafd3e2c6e4b2f76878215d503e8842da27 (patch)
tree246422575a6338acfc946ce501ae4e2df056ccf1 /src/pyinterp.cc
parent021fc50842a85d8357ca70c13e35b169a4d91e29 (diff)
downloadfork-ledger-8388baafd3e2c6e4b2f76878215d503e8842da27.tar.gz
fork-ledger-8388baafd3e2c6e4b2f76878215d503e8842da27.tar.bz2
fork-ledger-8388baafd3e2c6e4b2f76878215d503e8842da27.zip
Support Boost 1.46 and Boost.Filesystem v3
Diffstat (limited to 'src/pyinterp.cc')
-rw-r--r--src/pyinterp.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pyinterp.cc b/src/pyinterp.cc
index 8052f6a4..e0801604 100644
--- a/src/pyinterp.cc
+++ b/src/pyinterp.cc
@@ -137,7 +137,7 @@ void python_interpreter_t::hack_system_paths()
int n = python::extract<int>(paths.attr("__len__")());
for (int i = 0; i < n; i++) {
python::extract<std::string> str(paths[i]);
- path pathname(str);
+ path pathname(str());
DEBUG("python.interp", "sys.path = " << pathname);
if (exists(pathname / "ledger" / "__init__.py")) {
@@ -202,9 +202,15 @@ object python_interpreter_t::import_option(const string& str)
paths.insert(0, file.parent_path().string());
sys_dict["path"] = paths;
+#if BOOST_VERSION >= 104600
+ string name = file.filename().string();
+ if (contains(name, ".py"))
+ name = file.stem().string();
+#else
string name = file.filename();
if (contains(name, ".py"))
name = file.stem();
+#endif
#else // BOOST_VERSION >= 103700
paths.insert(0, file.branch_path().string());
sys_dict["path"] = paths;