Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 2 support, remove six #78

Merged
merged 1 commit into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: python
python:
- "2.7"
- "pypy"
- "3.4"
- "3.5"
Expand Down
9 changes: 4 additions & 5 deletions click_repl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import os
import shlex
import sys
import six
from .exceptions import InternalCommandException, ExitReplException # noqa

# Handle backwards compatibility between Click 7.0 and 8.0
Expand Down Expand Up @@ -42,7 +41,7 @@ def _register_internal_command(names, target, description=None):
if not hasattr(target, "__call__"):
raise ValueError("Internal command must be a callable")

if isinstance(names, six.string_types):
if isinstance(names, str):
names = [names]
elif not isinstance(names, (list, tuple)):
raise ValueError('"names" must be a string or a list / tuple')
Expand Down Expand Up @@ -71,14 +70,14 @@ def _help_internal():
with formatter.section("Internal Commands"):
formatter.write_text('prefix internal commands with ":"')
info_table = defaultdict(list)
for mnemonic, target_info in six.iteritems(_internal_commands):
for mnemonic, target_info in _internal_commands.items():
info_table[target_info[1]].append(mnemonic)
formatter.write_dl(
(
", ".join((":{0}".format(mnemonic) for mnemonic in sorted(mnemonics))),
description,
)
for description, mnemonics in six.iteritems(info_table)
for description, mnemonics in info_table.items()
)
return formatter.getvalue()

Expand Down Expand Up @@ -242,7 +241,7 @@ def get_command():
if allow_internal_commands:
try:
result = handle_internal_commands(command)
if isinstance(result, six.string_types):
if isinstance(result, str):
click.echo(result)
continue
except ExitReplException:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
url="https://github.com/untitaker/click-repl",
license="MIT",
packages=["click_repl"],
install_requires=["click", "prompt_toolkit", "six"],
install_requires=["click", "prompt_toolkit"],
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{27,py,34,35,36,37}
py{py,34,35,36,37}
linters

[testenv]
Expand Down