From 0fa3c1d8765a6ac39daccc3b0806d5ac396c92bc Mon Sep 17 00:00:00 2001 From: rht Date: Wed, 27 Sep 2017 10:14:26 +0200 Subject: [PATCH] zerver/management: Remove `import six`. --- zerver/management/commands/email_mirror.py | 6 +----- zerver/management/commands/realm_emoji.py | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/zerver/management/commands/email_mirror.py b/zerver/management/commands/email_mirror.py index 0c218d8bc1..25be8f9c23 100755 --- a/zerver/management/commands/email_mirror.py +++ b/zerver/management/commands/email_mirror.py @@ -25,7 +25,6 @@ recipient address and retrieve, forward, and archive the message. from __future__ import print_function -import six from typing import Any, List, Generator import logging @@ -65,10 +64,7 @@ def get_imap_messages(): for msgid in num_ids_data[0].split(): status, msg_data = mbox.fetch(msgid, '(RFC822)') msg_as_bytes = msg_data[0][1] - if six.PY2: - message = email.message_from_string(msg_as_bytes) - else: - message = email.message_from_bytes(msg_as_bytes) + message = email.message_from_bytes(msg_as_bytes) yield message mbox.store(msgid, '+FLAGS', '\\Deleted') mbox.expunge() diff --git a/zerver/management/commands/realm_emoji.py b/zerver/management/commands/realm_emoji.py index 5a574f7e8b..b9ec4df2d2 100644 --- a/zerver/management/commands/realm_emoji.py +++ b/zerver/management/commands/realm_emoji.py @@ -8,7 +8,6 @@ from django.core.management.base import BaseCommand, CommandParser from zerver.lib.actions import check_add_realm_emoji, do_remove_realm_emoji from zerver.lib.management import ZulipBaseCommand import sys -import six class Command(ZulipBaseCommand): help = """Manage emoji for the specified realm @@ -44,7 +43,7 @@ Example: ./manage.py realm_emoji --realm=zulip.com --op=show realm = self.get_realm(options) assert realm is not None # Should be ensured by parser if options["op"] == "show": - for name, url in six.iteritems(realm.get_emoji()): + for name, url in realm.get_emoji().items(): print(name, url) sys.exit(0)