mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-12 13:19:49 +01:00
Fix bug, yay.
This commit is contained in:
parent
97cfeef28c
commit
fe63755592
@ -31,10 +31,10 @@
|
|||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import fix
|
import supybot.fix as fix
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import conf
|
import supybot.conf as conf
|
||||||
import socket
|
import socket
|
||||||
import urllib2
|
import urllib2
|
||||||
import urlparse
|
import urlparse
|
||||||
@ -71,10 +71,12 @@ def strError(e):
|
|||||||
def getUrlFd(url):
|
def getUrlFd(url):
|
||||||
"""Gets a file-like object for a url."""
|
"""Gets a file-like object for a url."""
|
||||||
try:
|
try:
|
||||||
|
if not isinstance(url, urllib2.Request):
|
||||||
if '#' in url:
|
if '#' in url:
|
||||||
i = url.index('#')
|
url = url[:url.index('#')]
|
||||||
url = url[:i]
|
|
||||||
request = urllib2.Request(url)
|
request = urllib2.Request(url)
|
||||||
|
else:
|
||||||
|
request = url
|
||||||
httpProxy = conf.supybot.protocols.http.proxy()
|
httpProxy = conf.supybot.protocols.http.proxy()
|
||||||
if httpProxy:
|
if httpProxy:
|
||||||
request.set_proxy(httpProxy, 'http')
|
request.set_proxy(httpProxy, 'http')
|
||||||
|
Loading…
Reference in New Issue
Block a user