diff options
author | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2013-12-15 14:16:53 +0900 |
---|---|---|
committer | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2013-12-15 14:16:53 +0900 |
commit | a8fc938d1b9fb1be7979da8b8236aba287fc082e (patch) | |
tree | 751d6a1e72f6a59fd036eac63cf01d3c708857a7 /sphinx/util/osutil.py | |
parent | 95a07fe282a084862daca26a0ed781ab498395a8 (diff) | |
download | sphinx-git-a8fc938d1b9fb1be7979da8b8236aba287fc082e.tar.gz |
Drop python-2.5 and remove 2.4,2.5 support codes
Diffstat (limited to 'sphinx/util/osutil.py')
-rw-r--r-- | sphinx/util/osutil.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py index 87717771a..e8655fe1f 100644 --- a/sphinx/util/osutil.py +++ b/sphinx/util/osutil.py @@ -69,6 +69,10 @@ def ensuredir(path): raise +# TODO: This function can be removed because this function is same as os.walk +# of Python2.6, 2.7, 3.1, 3.2, 3.3. +# HOWEVER, this function is customized to check UnicodeError that obstacle to +# replace the function with the os.walk. def walk(top, topdown=True, followlinks=False): """Backport of os.walk from 2.6, where the *followlinks* argument was added. @@ -155,9 +159,8 @@ else: def safe_relpath(path, start=None): - from sphinx.util.pycompat import relpath try: - return relpath(path, start) + return os.path.relpath(path, start) except ValueError: return path @@ -171,14 +174,13 @@ def find_catalog(docname, compaction): def find_catalog_files(docname, srcdir, locale_dirs, lang, compaction): - from sphinx.util.pycompat import relpath if not(lang and locale_dirs): return [] domain = find_catalog(docname, compaction) files = [gettext.find(domain, path.join(srcdir, dir_), [lang]) for dir_ in locale_dirs] - files = [relpath(f, srcdir) for f in files if f] + files = [path.relpath(f, srcdir) for f in files if f] return files |