Use filesystem::complete not absolute with Boost < 1.46
This commit is contained in:
parent
9ec9cdf41e
commit
e493a3859c
2 changed files with 8 additions and 0 deletions
|
|
@ -110,7 +110,11 @@ inline parse_context_t open_for_reading(const path& pathname,
|
||||||
throw_(std::runtime_error,
|
throw_(std::runtime_error,
|
||||||
_("Cannot read journal file %1") << filename);
|
_("Cannot read journal file %1") << filename);
|
||||||
|
|
||||||
|
#if BOOST_VERSION >= 104600 && BOOST_FILESYSTEM_VERSION >= 3
|
||||||
path parent(filesystem::absolute(pathname, cwd).parent_path());
|
path parent(filesystem::absolute(pathname, cwd).parent_path());
|
||||||
|
#else
|
||||||
|
path parent(filesystem::complete(pathname, cwd).parent_path());
|
||||||
|
#endif
|
||||||
shared_ptr<std::istream> stream(new ifstream(filename));
|
shared_ptr<std::istream> stream(new ifstream(filename));
|
||||||
parse_context_t context(stream, parent);
|
parse_context_t context(stream, parent);
|
||||||
context.pathname = filename;
|
context.pathname = filename;
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,11 @@ object python_interpreter_t::import_option(const string& str)
|
||||||
if (contains(str, ".py")) {
|
if (contains(str, ".py")) {
|
||||||
#if BOOST_VERSION >= 103700
|
#if BOOST_VERSION >= 103700
|
||||||
path& cwd(parsing_context.get_current().current_directory);
|
path& cwd(parsing_context.get_current().current_directory);
|
||||||
|
#if BOOST_VERSION >= 104600 && BOOST_FILESYSTEM_VERSION >= 3
|
||||||
path parent(filesystem::absolute(file, cwd).parent_path());
|
path parent(filesystem::absolute(file, cwd).parent_path());
|
||||||
|
#else
|
||||||
|
path parent(filesystem::complete(file, cwd).parent_path());
|
||||||
|
#endif
|
||||||
DEBUG("python.interp", "Adding " << parent << " to PYTHONPATH");
|
DEBUG("python.interp", "Adding " << parent << " to PYTHONPATH");
|
||||||
paths.insert(0, parent.string());
|
paths.insert(0, parent.string());
|
||||||
sys_dict["path"] = paths;
|
sys_dict["path"] = paths;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue