mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-05 06:33:50 +02:00
python-automat: revert patch to unbreak on py2
This commit is contained in:
parent
fd0017bec2
commit
e014c34f1f
2 changed files with 38 additions and 1 deletions
37
srcpkgs/python-automat/patches/py2fix.patch
Normal file
37
srcpkgs/python-automat/patches/py2fix.patch
Normal file
|
@ -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()),
|
||||||
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'python-automat'
|
# Template file for 'python-automat'
|
||||||
pkgname=python-automat
|
pkgname=python-automat
|
||||||
version=22.10.0
|
version=22.10.0
|
||||||
revision=1
|
revision=2
|
||||||
build_style=python-module
|
build_style=python-module
|
||||||
hostmakedepends="python-setuptools python3-setuptools"
|
hostmakedepends="python-setuptools python3-setuptools"
|
||||||
depends="python-setuptools python-attrs python-six"
|
depends="python-setuptools python-attrs python-six"
|
||||||
|
|
Loading…
Add table
Reference in a new issue