Skip to content

Commit 11ec2a3

Browse files
committed
Remove redundant check
1 parent b4ac45c commit 11ec2a3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/pip/_internal/utils/compat.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import shutil
1010
import sys
1111

12-
from pip._vendor.six import PY2, PY3, text_type
12+
from pip._vendor.six import PY3, text_type
1313
from pip._vendor.urllib3.util import IS_PYOPENSSL
1414

1515
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
@@ -72,9 +72,8 @@
7272
# backslash replacement for all versions.
7373
def backslashreplace_decode_fn(err):
7474
raw_bytes = (err.object[i] for i in range(err.start, err.end))
75-
if PY2:
76-
# Python 2 gave us characters - convert to numeric bytes
77-
raw_bytes = (ord(b) for b in raw_bytes)
75+
# Python 2 gave us characters - convert to numeric bytes
76+
raw_bytes = (ord(b) for b in raw_bytes)
7877
return u"".join(u"\\x%x" % c for c in raw_bytes), err.end
7978
codecs.register_error(
8079
"backslashreplace_decode",

0 commit comments

Comments
 (0)