creeper-adventure/.venv/lib/python3.8/site-packages/mypy/backports.py
2022-03-31 20:20:07 -05:00

18 lines
502 B
Python

import sys
from contextlib import contextmanager
from typing import Iterator
if sys.version_info < (3, 6):
from collections import OrderedDict as OrderedDict # noqa: F401
else:
# OrderedDict is kind of slow, so for most of our uses in Python 3.6
# and later we'd rather just use dict
OrderedDict = dict
if sys.version_info < (3, 7):
@contextmanager
def nullcontext() -> Iterator[None]:
yield
else:
from contextlib import nullcontext as nullcontext # noqa: F401