mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Fix exceptions, and remove the timeout (Python 2.5 compatability)
This commit is contained in:
@@ -6,7 +6,7 @@ class DocumentRetrievalError(Exception):
|
|||||||
self.value = value
|
self.value = value
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.__doc__ % value
|
return self.__doc__ % self.value
|
||||||
|
|
||||||
class InvalidDocument(Exception):
|
class InvalidDocument(Exception):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class CachedDocumentManager(models.Manager):
|
|||||||
req = urllib2.Request(url)
|
req = urllib2.Request(url)
|
||||||
req.add_header('CCP-Contact', 'matalok@pleaseignore.com')
|
req.add_header('CCP-Contact', 'matalok@pleaseignore.com')
|
||||||
try:
|
try:
|
||||||
conn = urllib2.urlopen(req, timeout=60)
|
conn = urllib2.urlopen(req)
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
raise DocumentRetrievalError(e.code)
|
raise DocumentRetrievalError(e.code)
|
||||||
except urllib2.URLError, e:
|
except urllib2.URLError, e:
|
||||||
|
|||||||
Reference in New Issue
Block a user