diff options
| author | Michael Williamson <mike@zwobble.org> | 2018-01-27 17:20:52 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2018-01-27 17:20:52 +0000 |
| commit | f4adcf24ec4b7e2ec321718f6cfdb9870a8ed4a2 (patch) | |
| tree | ef9eebf63fb47e1760c2091794fdbe5cabca2d7a /mammoth/zips.py | |
| parent | 421c4a5eab36256f3d6feba4eaf8191cdeaf83d5 (diff) | |
Handle absolute paths in zips.join_path
Diffstat (limited to 'mammoth/zips.py')
| -rw-r--r-- | mammoth/zips.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mammoth/zips.py b/mammoth/zips.py index cca0b49..79e9b17 100644 --- a/mammoth/zips.py +++ b/mammoth/zips.py @@ -65,4 +65,13 @@ def split_path(path): def join_path(*args): - return "/".join(list(filter(None, args))) + non_empty_paths = list(filter(None, args)) + + relevant_paths = [] + for path in non_empty_paths: + if path.startswith("/"): + relevant_paths = [path] + else: + relevant_paths.append(path) + + return "/".join(relevant_paths) |
