File: 0001-remove-six.patch

package info (click to toggle)
python-pywebpush 2.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 300 kB
  • sloc: python: 853; makefile: 3
file content (49 lines) | stat: -rw-r--r-- 1,722 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From: Tianyu Chen <billchenchina2001@gmail.com>
Date: Fri, 8 Aug 2025 00:59:16 +0800
Subject: remove six

---
 pywebpush/__init__.py | 5 ++---
 requirements.txt      | 1 -
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/pywebpush/__init__.py b/pywebpush/__init__.py
index bbf776d..0989aea 100644
--- a/pywebpush/__init__.py
+++ b/pywebpush/__init__.py
@@ -19,7 +19,6 @@ except ImportError:  # pragma nocover
 import aiohttp
 import http_ece
 import requests
-import six
 from cryptography.hazmat.backends import default_backend
 from cryptography.hazmat.primitives.asymmetric import ec
 from cryptography.hazmat.primitives import serialization
@@ -175,7 +174,7 @@ class WebPusher:
             for k in ["p256dh", "auth"]:
                 if keys.get(k) is None:
                     raise WebPushException("Missing keys value: {}".format(k))
-                if isinstance(keys[k], six.text_type):
+                if isinstance(keys[k], str):
                     keys[k] = bytes(cast(str, keys[k]).encode("utf8"))
             receiver_raw = base64.urlsafe_b64decode(
                 self._repad(cast(bytes, keys["p256dh"]))
@@ -236,7 +235,7 @@ class WebPusher:
             format=serialization.PublicFormat.UncompressedPoint,
         )
 
-        if isinstance(data, six.text_type):
+        if isinstance(data, str):
             data = bytes(data.encode("utf8"))
         if content_encoding == "aes128gcm":
             self.verb("Encrypting to aes128gcm...")
diff --git a/requirements.txt b/requirements.txt
index 16f1e7c..eedfe85 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,5 +2,4 @@ aiohttp
 cryptography>=2.6.1
 http-ece>=1.1.0
 requests>=2.21.0
-six>=1.15.0
 py-vapid>=1.7.0