diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-06-17 19:23:33 +0100 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-06-17 19:23:33 +0100 |
commit | 744a61f18bbfcbf7dfaa08886185b4595d8b7bcb (patch) | |
tree | 0a46190af97901b276e7881b2e74ee46d5056d94 /release.py | |
parent | c003c86fc22b8d20b81226d1e74c95a5c885e314 (diff) | |
download | external_python_setuptools-744a61f18bbfcbf7dfaa08886185b4595d8b7bcb.tar.gz external_python_setuptools-744a61f18bbfcbf7dfaa08886185b4595d8b7bcb.tar.bz2 external_python_setuptools-744a61f18bbfcbf7dfaa08886185b4595d8b7bcb.zip |
Misc. updates following 2to3 checks.
--HG--
branch : single-codebase
Diffstat (limited to 'release.py')
-rw-r--r-- | release.py | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -18,6 +18,15 @@ import itertools import re try: + from urllib2 import urlopen, Request, HTTPError + from itertools import izip_longest +except ImportError: + from urllib.request import urlopen, Request + from urllib.error import HTTPError + raw_input = input + from itertools import zip_longest as izip_longest + +try: import keyring except Exception: pass @@ -99,11 +108,11 @@ def add_milestone_and_version(version): for type in 'milestones', 'versions': url = (base + '/1.0/repositories/{repo}/issues/{type}' .format(repo = get_repo_name(), type=type)) - req = urllib2.Request(url = url, headers = headers, + req = Request(url = url, headers = headers, data='name='+version) try: - urllib2.urlopen(req) - except urllib2.HTTPError as e: + urlopen(req) + except HTTPError as e: print(e.fp.read()) def bump_versions(target_ver): @@ -225,7 +234,7 @@ def _linkified_text(rst_content): anchors = [] linkified_parts = [_linkified_part(part, anchors) for part in plain_text_parts] - pairs = itertools.izip_longest( + pairs = izip_longest( linkified_parts, HREF_pattern.findall(rst_content), fillvalue='', |