Commit aae5cde8 by zhuochen Committed by Tianqi Chen

workaround typing.Deque import error for Python 3.5 (#4254)

parent 635831c7
...@@ -21,9 +21,21 @@ from __future__ import absolute_import ...@@ -21,9 +21,21 @@ from __future__ import absolute_import
import sys import sys
from ast import literal_eval from ast import literal_eval
from typing import Any, Deque, Dict, List, Optional, TypeVar, Tuple, Union
from collections import deque from collections import deque
try:
# no typing.Deque in Python 3.5
# https://bugs.python.org/issue29011
from typing import Any, Dict, List, Optional, TypeVar, Tuple, Union, MutableSequence, T, Deque
except ImportError:
class Deque(deque, MutableSequence[T], extra=deque):
def __new__(cls, *args, **kwds):
if _geqv(cls, Deque):
raise TypeError("Type Deque cannot be instantiated; "
"use deque() instead")
return deque.__new__(cls, *args, **kwds)
import tvm import tvm
from . import module from . import module
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment