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 sys
import time
import urllib
import urllib.parse
from typing import Dict, List, Tuple, Any
import feedparser

View file

@ -2,16 +2,13 @@
import argparse
import os
import six
import io
import unittest
import zulip
from unittest import TestCase
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):
@ -19,7 +16,7 @@ class TestDefaultArguments(TestCase):
# type: () -> None
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 patch('sys.stderr', new=six.StringIO()) as mock_stderr:
with patch('sys.stderr', new=io.StringIO()) as mock_stderr:
parser.parse_args(['invalid argument'])
self.assertEqual(cm.exception.code, 2)
# 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
import distro
from six.moves.configparser import SafeConfigParser
from six.moves import urllib
from configparser import SafeConfigParser
import urllib.parse
import logging
import six
from typing import Any, Callable, Dict, Iterable, IO, List, Mapping, Optional, Text, Tuple, Union
__version__ = "0.6.4"
@ -473,7 +472,7 @@ class Client(object):
request = {}
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):
request[key] = val
else: