nyx: fix python 3.11 compatibility
authorJavier Marcet <[email protected]>
Sat, 1 Jul 2023 18:32:53 +0000 (20:32 +0200)
committerJosef Schlehofer <[email protected]>
Fri, 7 Jul 2023 11:29:50 +0000 (13:29 +0200)
Signed-off-by: Javier Marcet <[email protected]>
admin/nyx/Makefile
admin/nyx/patches/01-python311.patch [new file with mode: 0644]

index 5a7e26b41fa6556d8472a4326fa236859b57bc84..1b023337bb0a6f0510a0ac64458057db37a2baed 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nyx
 PKG_VERSION:=2.1.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PYPI_NAME:=nyx
 PKG_HASH:=88521488d1c9052e457b9e66498a4acfaaa3adf3adc5a199892632f129a5390b
diff --git a/admin/nyx/patches/01-python311.patch b/admin/nyx/patches/01-python311.patch
new file mode 100644 (file)
index 0000000..36b3493
--- /dev/null
@@ -0,0 +1,32 @@
+From dcaddf2ab7f9d2ef8649f98bb6870995ebe0b893 Mon Sep 17 00:00:00 2001
+From: Juan Orti Alcaine <[email protected]>
+Date: Mon, 27 Jun 2022 19:38:34 +0200
+Subject: [PATCH] Replace inspect.getargspec usage to support python 3.11
+
+---
+ nyx/panel/__init__.py | 2 +-
+ test/__init__.py      | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/nyx/panel/__init__.py
++++ b/nyx/panel/__init__.py
+@@ -78,7 +78,7 @@ class KeyHandler(collections.namedtuple(
+       is_match = self._key_func(key) if self._key_func else key.match(self.key)
+       if is_match:
+-        if inspect.getargspec(self._action).args == ['key']:
++        if inspect.getfullargspec(self._action).args == ['key']:
+           self._action(key)
+         else:
+           self._action()
+--- a/test/__init__.py
++++ b/test/__init__.py
+@@ -94,7 +94,7 @@ def render(func, *args, **kwargs):
+     nyx.curses.CURSES_SCREEN.erase()
+     start_time = time.time()
+-    func_args = inspect.getargspec(func).args
++    func_args = inspect.getfullargspec(func).args
+     if func_args[:1] == ['subwindow'] or func_args[:2] == ['self', 'subwindow']:
+       def _draw(subwindow):