mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-13 17:02:12 -05:00
Merge pull request #5509 from stephenfin/remove-future-imports
Remove future imports
This commit is contained in:
26 files changed
+5
-33
No files matched your search
@@ -11,8 +11,6 @@
|
||||
# Keep this file executable as-is in Python 3!
|
||||
# (Otherwise getting the version out of it from setup.py is impossible.)
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import warnings
|
||||
from os import path
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import gzip
|
||||
import re
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from codecs import open
|
||||
from collections import defaultdict, OrderedDict
|
||||
from datetime import datetime, tzinfo, timedelta
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import argparse
|
||||
import locale
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import doctest
|
||||
import re
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import fnmatch
|
||||
import os
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
from typing import List, Tuple, cast
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import posixpath
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import base64
|
||||
import imghdr
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import builtins
|
||||
import enum
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
import logging.handlers
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import re
|
||||
from typing import Any, cast
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import warnings
|
||||
from contextlib import contextmanager
|
||||
from urllib.parse import urlsplit
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import re
|
||||
from contextlib import contextmanager
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
See the LICENSE file and the original docutils code for details.
|
||||
|
||||
"""
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import re
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Dict # NOQA
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
|
||||
import mod_resource
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from __future__ import absolute_import
|
||||
import enum
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# TODO(stephenfin): Removing this breaks tests. Why?
|
||||
from __future__ import absolute_import
|
||||
|
||||
from .submodule import func1, Class1 # NOQA
|
||||
@@ -1,4 +1,2 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from .mod1 import func1, Class1 # NOQA
|
||||
from .mod2 import func2, Class2 # NOQA
|
||||
@@ -1,6 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import os
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ def sphinx_has_header(physical_line, filename, lines, line_number):
|
||||
|
||||
# line number correction
|
||||
offset = 1
|
||||
if lines[0:1] == ['#!/usr/bin/env python\n']:
|
||||
if lines[0:1] == ['#!/usr/bin/env python3\n']:
|
||||
lines = lines[1:]
|
||||
offset = 2
|
||||
|
||||
|
||||
Reference in new issue
Block a user