mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +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 functools import partial
|
||||
from urllib.parse import urlparse
|
||||
import json
|
||||
import logging
|
||||
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):
|
||||
"""Create encrypted headers to send to WebPusher."""
|
||||
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
|
||||
ATTR_ENDPOINT in subscription_info):
|
||||
url = urlparse(subscription_info.get(ATTR_ENDPOINT))
|
||||
|
Loading…
x
Reference in New Issue
Block a user