Skip to content

Commit

Permalink
Merge pull request #166 from aapa/requests-pyopenssl
Browse files Browse the repository at this point in the history
Add dependencies to make Requests use PyOpenSSL by default
  • Loading branch information
lepinkainen committed Apr 17, 2015
2 parents 3331336 + ce2e7d8 commit 6e71193
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pyfibot/modules/module_urltitle.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import urlparse
import logging
import re
import sys
from datetime import datetime
import math

Expand All @@ -19,6 +20,11 @@

from bs4 import BeautifulSoup

use_lxml = False
if sys.hexversion < 0x02070000:
import lxml
use_lxml = True

log = logging.getLogger("urltitle")
config = None
bot = None
Expand Down Expand Up @@ -63,7 +69,10 @@ def __get_bs(url):

content = r.content
if content:
return BeautifulSoup(content)
if use_lxml:
return BeautifulSoup(content, 'lxml')
else:
return BeautifulSoup(content)
return None


Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pyyaml
jsonschema >= 1.0.0
beautifulsoup4
pyopenssl
ndg-httpsclient
pyasn1
tvdb_api
repoze.lru
pygeoip
Expand All @@ -16,3 +18,4 @@ httplib2 >= 0.8.0
feedparser >= 5.1.3
service_identity
python-dateutil >= 2.2
lxml; python_version < '2.7'

0 comments on commit 6e71193

Please sign in to comment.