diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-03-29 23:52:32 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-03-30 14:50:37 +0900 |
commit | 61098a0ae2e696a804459d36bd74ca57db76eda5 (patch) | |
tree | 2d71c39d199fec7366a013e0b48c1b2fb4bc83ee /sphinx/util/osutil.py | |
parent | c1a254f2491436ac304f1f169aa488438abe4193 (diff) | |
download | sphinx-git-61098a0ae2e696a804459d36bd74ca57db76eda5.tar.gz |
Drop features and APIs deprecated in 1.8
Diffstat (limited to 'sphinx/util/osutil.py')
-rw-r--r-- | sphinx/util/osutil.py | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py index 6a070a27a..4cd646f96 100644 --- a/sphinx/util/osutil.py +++ b/sphinx/util/osutil.py @@ -15,12 +15,11 @@ import os import re import shutil import sys -import time import warnings from io import StringIO from os import path -from sphinx.deprecation import RemovedInSphinx30Warning, RemovedInSphinx40Warning +from sphinx.deprecation import RemovedInSphinx40Warning if False: # For type annotation @@ -148,28 +147,6 @@ def make_filename_from_project(project): return make_filename(project_suffix_re.sub('', project)).lower() -def ustrftime(format, *args): - # type: (str, Any) -> str - """[DEPRECATED] strftime for unicode strings.""" - warnings.warn('sphinx.util.osutil.ustrtime is deprecated for removal', - RemovedInSphinx30Warning, stacklevel=2) - - if not args: - # If time is not specified, try to use $SOURCE_DATE_EPOCH variable - # See https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal - source_date_epoch = os.getenv('SOURCE_DATE_EPOCH') - if source_date_epoch is not None: - time_struct = time.gmtime(float(source_date_epoch)) - args = [time_struct] # type: ignore - # On Windows, time.strftime() and Unicode characters will raise UnicodeEncodeError. - # https://bugs.python.org/issue8304 - try: - return time.strftime(format, *args) - except UnicodeEncodeError: - r = time.strftime(format.encode('unicode-escape').decode(), *args) - return r.encode().decode('unicode-escape') - - def relpath(path, start=os.curdir): # type: (str, str) -> str """Return a relative filepath to *path* either from the current directory or |