Source code for pureyaml._compat

# coding=utf-8
"""Python 2to3 compatibility handling."""
from __future__ import absolute_import

try:
    from logging import NullHandler
except ImportError:  # pragma: no cover
    import logging  # :off

    # Python 2.6
    class NullHandler(logging.Handler):  # :on
        def emit(self, record):
            pass

try:
    from collections import abc as collections_abc
except ImportError:
    import collections  # :off

    # noinspection PyClassHasNoInit,PyPep8Naming
[docs] class collections_abc: # noqa Hashable = collections.Hashable # :on Iterable = collections.Iterable Iterator = collections.Iterator Sized = collections.Sized Container = collections.Container Callable = collections.Callable Set = collections.Set MutableSet = collections.MutableSet Mapping = collections.Mapping MutableMapping = collections.MutableMapping MappingView = collections.MappingView KeysView = collections.KeysView ItemsView = collections.ItemsView ValuesView = collections.ValuesView Sequence = collections.Sequence MutableSequence = collections.MutableSequence
try: from functools import total_ordering except ImportError: from .total_ordering import total_ordering try: from functools import singledispatch except ImportError: from .singledispatch import singledispatch __all__ = ['NullHandler', 'collections_abc', 'total_ordering', 'singledispatch']