summaryrefslogtreecommitdiff
path: root/src/flake8/options/manager.py
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2021-03-29 18:11:37 -0700
committerAnthony Sottile <asottile@umich.edu>2021-03-30 17:37:13 -0700
commit3a85c8ce96d5c7c4c8250921734a826ac95e89b3 (patch)
tree40f33e38cf42e7a447e23a6d6924e4e2ee271a84 /src/flake8/options/manager.py
parent5b9edd04eeb184922f38f28dd682317d56372592 (diff)
downloadflake8-3a85c8ce96d5c7c4c8250921734a826ac95e89b3.tar.gz
clean up string_types
Diffstat (limited to 'src/flake8/options/manager.py')
-rw-r--r--src/flake8/options/manager.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/flake8/options/manager.py b/src/flake8/options/manager.py
index 5e0fee2..f537a42 100644
--- a/src/flake8/options/manager.py
+++ b/src/flake8/options/manager.py
@@ -82,11 +82,11 @@ def _flake8_normalize(value, *args, **kwargs):
raise TypeError(f"Unexpected keyword args: {kwargs}")
ret = value # type: Union[str, List[str]]
- if comma_separated_list and isinstance(ret, utils.string_types):
+ if comma_separated_list and isinstance(ret, str):
ret = utils.parse_comma_separated_list(value)
if normalize_paths:
- if isinstance(ret, utils.string_types):
+ if isinstance(ret, str):
ret = utils.normalize_path(ret, *args)
else:
ret = utils.normalize_paths(ret, *args)
@@ -212,7 +212,7 @@ class Option:
nargs = 0
# optparse -> argparse for `type`
- if isinstance(type, utils.string_types):
+ if isinstance(type, str):
LOG.warning(
"option %s: please update from optparse string `type=` to "
"argparse callable `type=` -- this will be an error in the "
@@ -299,9 +299,7 @@ class Option:
def normalize(self, value, *normalize_args):
# type: (Any, *str) -> Any
"""Normalize the value based on the option configuration."""
- if self.comma_separated_list and isinstance(
- value, utils.string_types
- ):
+ if self.comma_separated_list and isinstance(value, str):
value = utils.parse_comma_separated_list(value)
if self.normalize_paths: