Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ build-backend = "setuptools.build_meta"

[project]
name = "pywebpush"
version = "2.1.2"
version = "2.2.0"
requires-python = ">= 3.10"
license = { text = "MPL-2.0" }
authors = [{ name = "JR Conlin", email = "[email protected]" }]
description = "WebPush publication library"
Expand Down
5 changes: 2 additions & 3 deletions pywebpush/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
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
Expand Down Expand Up @@ -175,7 +174,7 @@ def __init__(
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"]))
Expand Down Expand Up @@ -236,7 +235,7 @@ def encode(
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...")
Expand Down