Eric Johnson  committed 69f643b

removed urllib2 and replaced with equivalent urllib.request, urllib.parse, and urllib.error imports and calls

  • Participants
  • Parent commits 26cbabd

Comments (0)

Files changed (1)

File src/bbi/

 import os
 import sys
 import re
-import urllib2
+import urllib
 import tempfile
 import subprocess
 import textwrap
-from urllib2 import build_opener, HTTPCookieProcessor, Request
-from urllib import urlencode
+from urllib.request import build_opener, HTTPCookieProcessor, Request
+from urllib.parse import urlencode
+from urllib.error import HTTPError, URLError
 from subprocess import Popen, PIPE
 opener = build_opener(HTTPCookieProcessor)
         if method == 'PUT' or method == 'DELETE':
             request.get_method = lambda: method
-    except urllib2.HTTPError as info:
+    except HTTPError as info:
         raise Exception("server problem (%s)" % info)
-    except urllib2.URLError:
+    except URLError:
         raise Exception("connection problem")