Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(exhale): remove outdated compatibility #208

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions exhale/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@
from sphinx.util import logging
from types import FunctionType, ModuleType

try:
# Python 2 StringIO
from cStringIO import StringIO
except ImportError:
# Python 3 StringIO
from io import StringIO
from io import StringIO


logger = logging.getLogger(__name__)
Expand Down
14 changes: 2 additions & 12 deletions exhale/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@
import textwrap

from bs4 import BeautifulSoup

try:
# Python 2 StringIO
from cStringIO import StringIO
except ImportError:
# Python 3 StringIO
from io import StringIO
from io import StringIO

__all__ = ["ExhaleRoot", "ExhaleNode"]

Expand Down Expand Up @@ -4038,11 +4032,7 @@ class view hierarchy. It will be present in the file page it was declared in
- Directories
- Files
'''
try:
from collections.abc import MutableMapping
except ImportError:
# TODO: remove when dropping python 2.7
from collections import MutableMapping
from collections.abc import MutableMapping
class UnabridgedDict(MutableMapping):
def __init__(self):
self.items = {}
Expand Down
6 changes: 1 addition & 5 deletions exhale/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,7 @@ def time_string(start, end):


def get_time():
if sys.version_info > (3, 3):
# monotonic introduced in 3.3
return time.monotonic()
else:
return time.time()
return time.monotonic()


AVAILABLE_KINDS = [
Expand Down
6 changes: 1 addition & 5 deletions testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
"""

from __future__ import unicode_literals
try:
from collections.abc import Mapping
except ImportError:
# TODO: remove when dropping python 2.7
from collections import Mapping
from collections.abc import Mapping


def deep_update(orig, override):
Expand Down
Loading