Remove all remaining six imports.

This commit is contained in:
rht 2020-04-03 05:23:36 -04:00 committed by showell
parent 565106b880
commit 439c096eac
3 changed files with 7 additions and 11 deletions

View file

@ -14,7 +14,7 @@ import os
import re import re
import sys import sys
import time import time
import urllib import urllib.parse
from typing import Dict, List, Tuple, Any from typing import Dict, List, Tuple, Any
import feedparser import feedparser

View file

@ -2,15 +2,12 @@
import argparse import argparse
import os import os
import six import io
import unittest import unittest
import zulip import zulip
from unittest import TestCase from unittest import TestCase
from zulip import ZulipError from zulip import ZulipError
if six.PY2:
from mock import patch
else:
from unittest.mock import patch from unittest.mock import patch
class TestDefaultArguments(TestCase): class TestDefaultArguments(TestCase):
@ -19,7 +16,7 @@ class TestDefaultArguments(TestCase):
# type: () -> None # type: () -> None
parser = zulip.add_default_arguments(argparse.ArgumentParser(usage="lorem ipsum")) parser = zulip.add_default_arguments(argparse.ArgumentParser(usage="lorem ipsum"))
with self.assertRaises(SystemExit) as cm: # type: ignore # error: "assertRaises" doesn't match argument types with self.assertRaises(SystemExit) as cm: # type: ignore # error: "assertRaises" doesn't match argument types
with patch('sys.stderr', new=six.StringIO()) as mock_stderr: with patch('sys.stderr', new=io.StringIO()) as mock_stderr:
parser.parse_args(['invalid argument']) parser.parse_args(['invalid argument'])
self.assertEqual(cm.exception.code, 2) self.assertEqual(cm.exception.code, 2)
# Assert that invalid arguments exit with printing the full usage (non-standard behavior) # Assert that invalid arguments exit with printing the full usage (non-standard behavior)

View file

@ -15,10 +15,9 @@ import types
from distutils.version import LooseVersion from distutils.version import LooseVersion
import distro import distro
from six.moves.configparser import SafeConfigParser from configparser import SafeConfigParser
from six.moves import urllib import urllib.parse
import logging import logging
import six
from typing import Any, Callable, Dict, Iterable, IO, List, Mapping, Optional, Text, Tuple, Union from typing import Any, Callable, Dict, Iterable, IO, List, Mapping, Optional, Text, Tuple, Union
__version__ = "0.6.4" __version__ = "0.6.4"
@ -473,7 +472,7 @@ class Client(object):
request = {} request = {}
req_files = [] req_files = []
for (key, val) in six.iteritems(orig_request): for (key, val) in orig_request.items():
if isinstance(val, str) or isinstance(val, Text): if isinstance(val, str) or isinstance(val, Text):
request[key] = val request[key] = val
else: else: