Permalink
Browse files

Fixed Python 2.5-ism.

git-svn-id: https://pysolr.googlecode.com/svn/trunk@8 13ae9d4a-4d43-0410-997b-81b7443f7ec1
  • Loading branch information...
1 parent 46849b1 commit 2f5d52ff157aa8ae1486ad0b6434cc52f2b149b8 @jkocherhans committed Jan 24, 2008
Showing with 8 additions and 4 deletions.
  1. +8 −4 pysolr.py
View
@@ -130,10 +130,14 @@ def __iter__(self):
class Solr(object):
def __init__(self, url):
self.url = url
- self.o = urlsplit(url)
- self.host = self.o.hostname
- self.port = self.o.port
- self.path = self.o.path.rstrip('/')
+ scheme, netloc, path, query, fragment = urlsplit(url)
+ netloc = netloc.split(':')
+ self.host = netloc[0]
+ if len(netloc) == 1:
+ self.host = netloc[0]
+ else:
+ self.host, self.port = netloc
+ self.path = path.rstrip('/')
def _select(self, params):
# encode the query as utf-8 so urlencode can handle it

0 comments on commit 2f5d52f

Please sign in to comment.