Skip to content

Commit

Permalink
Remove six references
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Stringer authored and gifflen committed Jun 10, 2020
1 parent 93d46e3 commit c2946f4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
17 changes: 8 additions & 9 deletions fleece/cli/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import boto3
import ruamel.yaml as yaml
import ruamel.yaml.comments
import six

from fleece.cli.run import run

Expand Down Expand Up @@ -112,9 +111,9 @@ def _decrypt_text(text, stage):


def _encrypt_item(data, stage, key):
if (
isinstance(data, six.text_type) or isinstance(data, six.binary_type)
) and data.startswith(":encrypt:"):
if (isinstance(data, str) or isinstance(data, bytes)) and data.startswith(
":encrypt:"
):
if not stage:
sys.stderr.write(
f'Warning: Key "{key}" cannot be encrypted because it does not belong to a stage\n'
Expand Down Expand Up @@ -168,9 +167,9 @@ def import_config(args, input_file=None):


def _decrypt_item(data, stage, key, render):
if (
isinstance(data, six.text_type) or isinstance(data, six.binary_type)
) and data.startswith(":decrypt:"):
if (isinstance(data, str) or isinstance(data, bytes)) and data.startswith(
":decrypt:"
):
data = _decrypt_text(data[9:], stage)
if not render or render == "ssm":
data = ":encrypt:" + data
Expand Down Expand Up @@ -298,7 +297,7 @@ def validate(name, value):
f'Error: invalid parameter name "{name}". Parameter store names may consist of only symbols and letters (a-zA-Z0-9_.-/)'
)

if not isinstance(value, (six.string_types, dict)):
if not isinstance(value, (str, dict)):
raise ValueError(
f"Error: all config values must be strings or dictionaries to work with parameter store, can't handle {name} of type {type(value)}"
)
Expand Down Expand Up @@ -337,7 +336,7 @@ def put(name, value):
if isinstance(value, dict):
for k, v in value.items():
put(f"{name}/{k}", v)
elif isinstance(value, six.string_types):
elif isinstance(value, str):
ps_name = name
print(f"Writing {ps_name}...")
if ssm_kms_key is not None:
Expand Down
3 changes: 1 addition & 2 deletions fleece/handlers/connexion.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from urllib.parse import urlencode

import connexion
import six
import werkzeug.wrappers

import fleece.log
Expand Down Expand Up @@ -187,7 +186,7 @@ def _build_wsgi_env(event, app_name):
request = event["parameters"]["request"]
ctx = event["rawContext"]
headers = request["header"]
body = six.text_type(json.dumps(request["body"]))
body = str(json.dumps(request["body"]))

# Render the path correctly so connexion/flask will pass the path params to
# the handler function correctly.
Expand Down
3 changes: 1 addition & 2 deletions fleece/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from random import random

import structlog
from six import string_types

LOG_FORMAT = "%(message)s"
DEFAULT_STREAM = sys.stdout
Expand Down Expand Up @@ -105,7 +104,7 @@ def _has_streamhandler(logger, level=None, fmt=LOG_FORMAT, stream=DEFAULT_STREAM
"""
# Ensure we are talking the same type of logging levels
# if they passed in a string we need to convert it to a number
if isinstance(level, string_types):
if isinstance(level, str):
level = logging.getLevelName(level)

for handler in logger.handlers:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Flask = { version = ">=1.1.1", optional = true }
docker = { version = ">=3.5.1", optional = true }
PyYAML = { version = ">=3.12", optional = true }
"ruamel.yaml" = { version = ">=0.15.34", optional = true }
six = { version = ">=1.11.0", optional = true}
# wsgi and connecxion
Werkzeug = { version = ">=0.15.5", optional = true }
structlog = ">=15.3.0"
Expand Down

0 comments on commit c2946f4

Please sign in to comment.