From 39a6b822b63d613ccdb72ecf26fef9736aeaba01 Mon Sep 17 00:00:00 2001 From: Tomas Hrnciar Date: Wed, 3 Mar 2021 17:10:50 +0100 Subject: [PATCH] Use functools from standard library on Python 3.7+ instead of singledispatch --- jaraco/path.py | 6 +++++- setup.cfg | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/jaraco/path.py b/jaraco/path.py index 8f782f1..d94dc2d 100644 --- a/jaraco/path.py +++ b/jaraco/path.py @@ -4,6 +4,7 @@ import os import re +import sys import itertools import functools import calendar @@ -18,7 +19,10 @@ import pathlib from typing import Dict, Union -from singledispatch import singledispatch +if sys.version_info >= (3, 7): + from functools import singledispatch +else: + from singledispatch import singledispatch log = logging.getLogger(__name__) diff --git a/setup.cfg b/setup.cfg index 00f700d..03fdcf3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,7 @@ python_requires = >=3.6 install_requires = pyobjc; platform_system == "Darwin" and platform_python_implementation != "PyPy" # until Python 3.6 is dropped - singledispatch >= 3.6 + singledispatch >= 3.6;python_version<"3.7" setup_requires = setuptools_scm[toml] >= 3.4.1 [options.packages.find]