diff --git a/scripts/lib/email-mirror-postfix b/scripts/lib/email-mirror-postfix index 0eef527af7..b3ce80534d 100755 --- a/scripts/lib/email-mirror-postfix +++ b/scripts/lib/email-mirror-postfix @@ -51,7 +51,6 @@ from urllib.parse import urljoin, urlencode from urllib.request import Request, urlopen from urllib.error import HTTPError from configparser import RawConfigParser -from six import text_type parser = OptionParser() @@ -93,7 +92,7 @@ def process_response_error(e): def send_email_mirror(rcpt_to, shared_secret, host, url, test, verify_ssl): - # type: (text_type, text_type, text_type, text_type, bool, bool) -> None + # type: (str, str, str, str, bool, bool) -> None if not rcpt_to: print("5.1.1 Bad destination mailbox address: No missed message email address.") exit(posix.EX_NOUSER) # type: ignore # There are no stubs for posix in python 3 diff --git a/zerver/webhooks/delighted/view.py b/zerver/webhooks/delighted/view.py index 7b680cf214..7247f7a855 100644 --- a/zerver/webhooks/delighted/view.py +++ b/zerver/webhooks/delighted/view.py @@ -6,7 +6,6 @@ from zerver.lib.request import REQ, has_request_variables from zerver.models import UserProfile from django.http import HttpRequest, HttpResponse -from six import text_type from typing import Dict, Any, Optional def body_template(score: int) -> str: @@ -21,7 +20,7 @@ def api_delighted_webhook(request, user_profile, payload=REQ(argument_type='body'), stream=REQ(default='delighted'), topic=REQ(default='Survey Response')): - # type: (HttpRequest, UserProfile, Dict[str, Dict[str, Any]], text_type, text_type) -> HttpResponse + # type: (HttpRequest, UserProfile, Dict[str, Dict[str, Any]], str, str) -> HttpResponse person = payload['event_data']['person'] selected_payload = {'email': person['email']} selected_payload['score'] = payload['event_data']['score'] diff --git a/zerver/webhooks/hellosign/view.py b/zerver/webhooks/hellosign/view.py index 40b5f17d40..4e473b4fbf 100644 --- a/zerver/webhooks/hellosign/view.py +++ b/zerver/webhooks/hellosign/view.py @@ -7,7 +7,6 @@ from zerver.lib.request import REQ, has_request_variables from zerver.models import UserProfile from django.http import HttpRequest, HttpResponse -from six import text_type from typing import Any, Dict, List def format_body(signatories: List[Dict[str, Any]], model_payload: Dict[str, Any]) -> str: @@ -45,7 +44,7 @@ def api_hellosign_webhook(request, user_profile, payload=REQ(argument_type='body'), stream=REQ(default='hellosign'), topic=REQ(default=None)): - # type: (HttpRequest, UserProfile, Dict[str, Dict[str, Any]], text_type, text_type) -> HttpResponse + # type: (HttpRequest, UserProfile, Dict[str, Dict[str, Any]], str, str) -> HttpResponse model_payload = ready_payload(payload['signature_request']['signatures'], payload) body = format_body(payload['signature_request']['signatures'], model_payload) topic = topic or model_payload['contract_title'] diff --git a/zerver/webhooks/slack/tests.py b/zerver/webhooks/slack/tests.py index 89c3c324c2..6ca6a262bf 100644 --- a/zerver/webhooks/slack/tests.py +++ b/zerver/webhooks/slack/tests.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- from zerver.lib.test_classes import WebhookTestCase -from six import text_type class SlackWebhookTests(WebhookTestCase): @@ -52,6 +51,6 @@ class SlackWebhookTests(WebhookTestCase): result = self.client_post(url, payload, content_type="application/x-www-form-urlencoded") self.assert_json_error(result, 'Error: channels_map_to_topics parameter other than 0 or 1') - def get_body(self, fixture_name: text_type) -> text_type: + def get_body(self, fixture_name: str) -> str: return self.fixture_data("slack", fixture_name, file_type="txt") diff --git a/zerver/webhooks/wordpress/tests.py b/zerver/webhooks/wordpress/tests.py index 9267c84879..8592787683 100644 --- a/zerver/webhooks/wordpress/tests.py +++ b/zerver/webhooks/wordpress/tests.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from six import text_type from zerver.lib.test_classes import WebhookTestCase from zerver.models import get_realm, get_user @@ -89,5 +88,5 @@ class WordPressHookTests(WebhookTestCase): self.assert_json_error(result, "Unknown WordPress webhook action: WordPress Action") - def get_body(self, fixture_name: text_type) -> text_type: + def get_body(self, fixture_name: str) -> str: return self.fixture_data("wordpress", fixture_name, file_type="txt") diff --git a/zerver/webhooks/wordpress/view.py b/zerver/webhooks/wordpress/view.py index b961405d1b..e3d22fdbab 100644 --- a/zerver/webhooks/wordpress/view.py +++ b/zerver/webhooks/wordpress/view.py @@ -8,8 +8,6 @@ from zerver.lib.response import json_success, json_error from zerver.lib.request import REQ, has_request_variables from zerver.models import get_client, UserProfile -from six import text_type - PUBLISH_POST_OR_PAGE_TEMPLATE = 'New {type} published.\n[{title}]({url})' USER_REGISTER_TEMPLATE = 'New blog user registered.\nName: {name}\nemail: {email}' WP_LOGIN_TEMPLATE = 'User {name} logged in.' @@ -26,7 +24,7 @@ def api_wordpress_webhook(request, user_profile, display_name=REQ(default="New User Name"), user_email=REQ(default="New User Email"), user_login=REQ(default="Logged in User")): - # type: (HttpRequest, UserProfile, text_type, text_type, text_type, text_type, text_type, text_type, text_type, text_type, text_type) -> HttpResponse + # type: (HttpRequest, UserProfile, str, str, str, str, str, str, str, str, str) -> HttpResponse # remove trailing whitespace (issue for some test fixtures) hook = hook.rstrip()