Skip to content

Commit 4d57008

Browse files
committed
Use six module for accessing collections.abc
1 parent b85a5e5 commit 4d57008

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ typing>=3.6,<3.7;python_version=='3.4'
55
typing>=3.6,<3.7;python_version=='3.3'
66
setuptools<=44.1;python_version<"3"
77
typing>=3.7;python_version<"3"
8+
six>=1.13.0

setuptools_git_versioning.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
from setuptools.dist import Distribution
55
from distutils.errors import DistutilsSetupError
66
from typing import List, Optional, Any
7-
8-
try:
9-
from collections.abc import Mapping
10-
except ImportError:
11-
from collections import Mapping
7+
from six.moves import collections_abc
128

139
DEFAULT_TEMPLATE = "{tag}" # type: str
1410
DEFAULT_DEV_TEMPLATE = "{tag}.dev{ccount}+git.{sha}" # type: str
@@ -84,7 +80,7 @@ def parse_config(dist, _, value): # type: (Distribution, Any, Any) -> None
8480
else:
8581
raise DistutilsSetupError("Can't be False")
8682

87-
if not isinstance(value, Mapping):
83+
if not isinstance(value, collections_abc.Mapping):
8884
raise DistutilsSetupError("Config in the wrong format")
8985

9086
template = value.get('template', DEFAULT_TEMPLATE)

0 commit comments

Comments
 (0)