From 46b528feaa7b13beaf408692b547224264e4055b Mon Sep 17 00:00:00 2001 From: Andrew Benson Date: Thu, 26 Jan 2023 22:21:38 -0600 Subject: [PATCH] python-automat: revert patch to unbreak on py2 --- srcpkgs/python-automat/patches/py2fix.patch | 37 +++++++++++++++++++++ srcpkgs/python-automat/template | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/python-automat/patches/py2fix.patch diff --git a/srcpkgs/python-automat/patches/py2fix.patch b/srcpkgs/python-automat/patches/py2fix.patch new file mode 100644 index 000000000000..8613b16afe9e --- /dev/null +++ b/srcpkgs/python-automat/patches/py2fix.patch @@ -0,0 +1,37 @@ +Our builders still use the py2 version of this package. + +--- a/automat/_methodical.py ++++ b/automat/_methodical.py +@@ -4,9 +4,15 @@ + from functools import wraps + from itertools import count + +-from inspect import getfullargspec as getArgsSpec ++try: ++ # Python 3 ++ from inspect import getfullargspec as getArgsSpec ++except ImportError: ++ # Python 2 ++ from inspect import getargspec as getArgsSpec + + import attr ++import six + + from ._core import Transitioner, Automaton + from ._introspection import preserveName +@@ -30,13 +36,13 @@ + return ArgSpec( + args=tuple(spec.args), + varargs=spec.varargs, +- varkw=spec.varkw, ++ varkw=spec.varkw if six.PY3 else spec.keywords, + defaults=spec.defaults if spec.defaults else (), + kwonlyargs=tuple(spec.kwonlyargs), + kwonlydefaults=( + tuple(spec.kwonlydefaults.items()) + if spec.kwonlydefaults else () +- ), ++ ) if six.PY3 else (), + annotations=tuple(spec.annotations.items()), + ) + diff --git a/srcpkgs/python-automat/template b/srcpkgs/python-automat/template index a95e8d59bf8e..bc9ea242cfe2 100644 --- a/srcpkgs/python-automat/template +++ b/srcpkgs/python-automat/template @@ -1,7 +1,7 @@ # Template file for 'python-automat' pkgname=python-automat version=22.10.0 -revision=1 +revision=2 build_style=python-module hostmakedepends="python-setuptools python3-setuptools" depends="python-setuptools python-attrs python-six"