Skip to content

Commit

Permalink
Replace more six
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Dec 22, 2020
1 parent 817ee23 commit 33f48e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/pip/_internal/pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
from collections import namedtuple

from pip._vendor import six, toml
from pip._vendor import toml
from pip._vendor.packaging.requirements import InvalidRequirement, Requirement

from pip._internal.exceptions import InstallationError
Expand All @@ -18,7 +18,7 @@ def _is_list_of_str(obj):
# type: (Any) -> bool
return (
isinstance(obj, list) and
all(isinstance(item, six.string_types) for item in obj)
all(isinstance(item, str) for item in obj)
)


Expand Down
4 changes: 2 additions & 2 deletions src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def __str__(self):
if self.satisfied_by is not None:
s += ' in {}'.format(display_path(self.satisfied_by.location))
if self.comes_from:
if isinstance(self.comes_from, six.string_types):
if isinstance(self.comes_from, str):
comes_from = self.comes_from # type: Optional[str]
else:
comes_from = self.comes_from.from_path()
Expand Down Expand Up @@ -334,7 +334,7 @@ def from_path(self):
return None
s = str(self.req)
if self.comes_from:
if isinstance(self.comes_from, six.string_types):
if isinstance(self.comes_from, str):
comes_from = self.comes_from
else:
comes_from = self.comes_from.from_path()
Expand Down
8 changes: 2 additions & 6 deletions tests/lib/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
import shutil
import sys
import textwrap
import venv as _venv

import six
import virtualenv as _virtualenv

from .path import Path

if six.PY3:
import venv as _venv


class VirtualEnvironment(object):
"""
Expand All @@ -37,8 +34,7 @@ def _update_paths(self):
self.site = Path(lib) / 'site-packages'
# Workaround for https://github.com/pypa/virtualenv/issues/306
if hasattr(sys, "pypy_version_info"):
version_fmt = '{0}' if six.PY3 else '{0}.{1}'
version_dir = version_fmt.format(*sys.version_info)
version_dir = '{0}'.format(*sys.version_info)
self.lib = Path(home, 'lib-python', version_dir)
else:
self.lib = Path(lib)
Expand Down

0 comments on commit 33f48e2

Please sign in to comment.