summaryrefslogtreecommitdiff
path: root/setuptools/package_index.py
diff options
context:
space:
mode:
authorBastian Venthur <bastian.venthur@flixbus.com>2020-02-11 09:55:35 +0100
committerBastian Venthur <bastian.venthur@flixbus.com>2020-02-11 09:55:35 +0100
commit087c3b26eed9b6a8960815c2773edd04b5c91a98 (patch)
treec0b0bf68b6f02980f742611c9232405ab9df299b /setuptools/package_index.py
parentc11270aa6bffd8913c6e074f09b9d920c8f19002 (diff)
parenta5dec2f14e3414e4ee5dd146bff9c289d573de9a (diff)
downloadpython-setuptools-git-087c3b26eed9b6a8960815c2773edd04b5c91a98.tar.gz
Merge branch 'master' into fix/1700
Diffstat (limited to 'setuptools/package_index.py')
-rw-r--r--setuptools/package_index.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 6b06f2ca..82eb4516 100644
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -46,7 +46,8 @@ __all__ = [
_SOCKET_TIMEOUT = 15
_tmpl = "setuptools/{setuptools.__version__} Python-urllib/{py_major}"
-user_agent = _tmpl.format(py_major=sys.version[:3], setuptools=setuptools)
+user_agent = _tmpl.format(
+ py_major='{}.{}'.format(*sys.version_info), setuptools=setuptools)
def parse_requirement_arg(spec):
@@ -1092,7 +1093,8 @@ def open_with_auth(url, opener=urllib.request.urlopen):
# copy of urllib.parse._splituser from Python 3.8
def _splituser(host):
- """splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'."""
+ """splituser('user[:passwd]@host[:port]')
+ --> 'user[:passwd]', 'host[:port]'."""
user, delim, host = host.rpartition('@')
return (user if delim else None), host