From 67f5a210193eb946adce2159fd09e290a4b05bcf Mon Sep 17 00:00:00 2001 From: pictuga Date: Sat, 18 Mar 2017 23:03:04 -1000 Subject: [PATCH] Move build_opener to crawler Forgotten --- morss/crawler.py | 4 ++-- morss/morss.py | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/morss/crawler.py b/morss/crawler.py index b2f440e..7b494b8 100644 --- a/morss/crawler.py +++ b/morss/crawler.py @@ -12,10 +12,10 @@ import sqlite3 import time try: - from urllib2 import BaseHandler, Request, addinfourl, parse_keqv_list, parse_http_list + from urllib2 import BaseHandler, Request, addinfourl, parse_keqv_list, parse_http_list, build_opener import mimetools except ImportError: - from urllib.request import BaseHandler, Request, addinfourl, parse_keqv_list, parse_http_list + from urllib.request import BaseHandler, Request, addinfourl, parse_keqv_list, parse_http_list, build_opener import email try: diff --git a/morss/morss.py b/morss/morss.py index 33d16b4..2b5b40d 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -25,14 +25,12 @@ from html2text import HTML2Text try: from Queue import Queue from httplib import HTTPException - from urllib2 import build_opener from urllib2 import HTTPError from urllib import quote_plus from urlparse import urlparse, urljoin, parse_qs except ImportError: from queue import Queue from http.client import HTTPException - from urllib.request import build_opener from urllib.error import HTTPError from urllib.parse import quote_plus from urllib.parse import urlparse, urljoin, parse_qs