From 8388baafd3e2c6e4b2f76878215d503e8842da27 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 28 Feb 2011 16:24:15 -0500 Subject: Support Boost 1.46 and Boost.Filesystem v3 --- src/pyinterp.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/pyinterp.cc') 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(paths.attr("__len__")()); for (int i = 0; i < n; i++) { python::extract 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; -- cgit v1.2.3