mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Remove some Python 2 compatibility code (#25341)
This commit is contained in:
parent
22d9a73e8e
commit
258dc80fbd
@ -2,6 +2,7 @@
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
from urllib.parse import urlparse
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
@ -534,10 +535,6 @@ def add_jwt(timestamp, target, tag, jwt_secret):
|
|||||||
def create_vapid_headers(vapid_email, subscription_info, vapid_private_key):
|
def create_vapid_headers(vapid_email, subscription_info, vapid_private_key):
|
||||||
"""Create encrypted headers to send to WebPusher."""
|
"""Create encrypted headers to send to WebPusher."""
|
||||||
from py_vapid import Vapid
|
from py_vapid import Vapid
|
||||||
try:
|
|
||||||
from urllib.parse import urlparse
|
|
||||||
except ImportError: # pragma: no cover
|
|
||||||
from urlparse import urlparse
|
|
||||||
if (vapid_email and vapid_private_key and
|
if (vapid_email and vapid_private_key and
|
||||||
ATTR_ENDPOINT in subscription_info):
|
ATTR_ENDPOINT in subscription_info):
|
||||||
url = urlparse(subscription_info.get(ATTR_ENDPOINT))
|
url = urlparse(subscription_info.get(ATTR_ENDPOINT))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user