Fix bug, yay.

This commit is contained in:
Jeremy Fincher 2004-07-24 05:07:24 +00:00
parent 97cfeef28c
commit fe63755592

View File

@ -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 '#' in url: if not isinstance(url, urllib2.Request):
i = url.index('#') if '#' in url:
url = url[:i] url = url[:url.index('#')]
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')