Skip to content

Commit

Permalink
Merge pull request #955 from python-cmd2/typing_deque
Browse files Browse the repository at this point in the history
Fix compatibility with Python 3.5 versions prior to 3.5.4
  • Loading branch information
tleonhardt authored Jul 14, 2020
2 parents 27a8414 + 95d6a25 commit 104f9af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmd2/table_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,21 @@
import io
from collections import deque
from enum import Enum
from typing import Any, Deque, Optional, Sequence, Tuple, Union
from typing import Any, Optional, Sequence, Tuple, Union

from wcwidth import wcwidth

from . import ansi, constants, utils

# This is needed for compatibility with early versions of Python 3.5 prior to 3.5.4
try:
from typing import Deque
except ImportError:
import typing

# noinspection PyProtectedMember, PyUnresolvedReferences
Deque = typing._alias(deque, typing.T)

# Constants
EMPTY = ''
SPACE = ' '
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"""
# Import for custom theme from Read the Docs
import sphinx_rtd_theme

import cmd2

# -- General configuration -----------------------------------------------------
Expand Down

0 comments on commit 104f9af

Please sign in to comment.