aboutsummaryrefslogtreecommitdiff
path: root/desktop/qtile-extras/python3.9_fixes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/qtile-extras/python3.9_fixes.patch')
-rw-r--r--desktop/qtile-extras/python3.9_fixes.patch94
1 files changed, 94 insertions, 0 deletions
diff --git a/desktop/qtile-extras/python3.9_fixes.patch b/desktop/qtile-extras/python3.9_fixes.patch
new file mode 100644
index 0000000000..4c6bc34bd1
--- /dev/null
+++ b/desktop/qtile-extras/python3.9_fixes.patch
@@ -0,0 +1,94 @@
+--- a/qtile_extras/layout/decorations/borders.py
++++ b/qtile_extras/layout/decorations/borders.py
+@@ -205,7 +205,7 @@
+ _BorderStyle.__init__(self, **config)
+ self.add_defaults(GradientBorder.defaults)
+
+- if not isinstance(self.colours, list | tuple):
++ if not isinstance(self.colours, (list, tuple)):
+ raise ConfigError("colours must be a list or tuple.")
+
+ if self.offsets is None:
+@@ -261,7 +261,7 @@
+ self.add_defaults(GradientFrame.defaults)
+ self.offsets = [x / (len(self.colours) - 1) for x in range(len(self.colours))]
+
+- if not isinstance(self.colours, list | tuple):
++ if not isinstance(self.colours, (list, tuple)):
+ raise ConfigError("colours must be a list or tuple.")
+
+ self._check_colours()
+@@ -408,7 +408,7 @@
+ _BorderStyle.__init__(self, **config)
+ self.add_defaults(SolidEdge.defaults)
+
+- if not (isinstance(self.colours, list | tuple) and len(self.colours) == 4):
++ if not (isinstance(self.colours, (list, tuple)) and len(self.colours) == 4):
+ raise ConfigError("colours must have 4 values.")
+
+ self._check_colours()
+@@ -488,7 +488,7 @@
+ return self.fallback
+
+ for match, colour in self.matches:
+- if isinstance(match, list | str):
++ if isinstance(match, (list, str)):
+ matched = any(m.compare(win) for m in match)
+ else:
+ matched = match.compare(win)
+--- a/qtile_extras/widget/decorations.py
++++ b/qtile_extras/widget/decorations.py
+@@ -72,9 +72,9 @@
+ self.parent = parent
+
+ def single_or_four(self, value, name: str):
+- if isinstance(value, float | int):
++ if isinstance(value, (float, int)):
+ n = e = s = w = value
+- elif isinstance(value, tuple | list):
++ elif isinstance(value, (tuple, list)):
+ if len(value) == 1:
+ n = e = s = w = value[0]
+ elif len(value) == 4:
+--- a/qtile_extras/widget/groupbox2.py
++++ b/qtile_extras/widget/groupbox2.py
+@@ -24,7 +24,7 @@
+ from copy import deepcopy
+ from enum import Flag, auto
+ from pathlib import Path
+-from typing import TYPE_CHECKING
++from typing import TYPE_CHECKING, Union
+
+ from cairocffi.pixbuf import ImageLoadingError
+ from libqtile import bar, hook
+@@ -39,8 +39,8 @@
+ from typing import Any, Literal
+
+
+-ColorType = str | tuple[int, int, int] | tuple[int, int, int, float]
+-ColorsType = ColorType | list[ColorType]
++ColorType = Union[str, tuple[int, int, int], tuple[int, int, int, float]]
++ColorsType = Union[ColorType, list[ColorType]]
+
+
+ IMAGE_CACHE: dict[str, Img] = {}
+--- a/qtile_extras/widget/statusnotifier.py
++++ b/qtile_extras/widget/statusnotifier.py
+@@ -32,7 +32,7 @@
+ from qtile_extras.widget.mixins import DbusMenuMixin
+
+ if TYPE_CHECKING:
+- from collections.abc import Callable
++ from typing import Callable, Optional
+
+ NO_MENU = "/NO_DBUSMENU"
+
+@@ -55,7 +55,7 @@
+ await self.menu.start()
+
+
+-def get_menu(self, root: int = 0, callback: Callable | None = None):
++def get_menu(self, root: int = 0, callback: Optional[Callable] = None):
+ if self.menu:
+ self.menu.get_menu(root, callback=callback)
+